问题描述
我的应用程序需要提醒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)buttonIndexthis 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查看 - 是/否条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!