我的应用程序需要提醒msg并使用是按钮单击另一个警报消息,它决定最终操作。 我用过 - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex 这个方法。
my app needs alert msg and with yes button click another alert msg which decides the final action. I have used - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex this method.
请帮助我。
推荐答案做什么@Adrian Pirvulescu说但在显示警告之前做 alert.tag = 1; 然后当 - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex 被调用do:
Do what @Adrian Pirvulescu said but before showing the alert do alert.tag = 1; and then when - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex is called do:
if (alertView.tag == 1) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"2nd Alert" message:@"My message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; alert.tag = 2; [alert show]; [alert release]; } else if (alertView.tag == 2) { [self CallSomeMethod]; } else { //do what ever you want here }更多推荐
UIAlert查看
发布评论