【发布时间】:2011-01-27 17:47:32
【问题描述】:
我遇到的问题是 UIAlertViewDelegate 方法 - (void)alertViewCancel:(UIAlertView *)alertView 在我使用取消按钮取消 AlertView 时未被调用。
奇怪的是委托方法 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 完美运行。
有人有想法吗?
提前致谢
肖恩
- (void)alertViewCancel:(UIAlertView *)alertView
{
if(![self aBooleanMethod])
{
exit(0);
}
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
//some code
}
点击按钮时我调用它:
- (void)ImagePickDone
{
UIAlertView *alertDone = [[UIAlertView alloc]
initWithTitle:@"Done"
message:@"Are u sure?"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles: @"Yes", nil];
[alertDone show];
[alertDone release];
}
【问题讨论】:
-
我们可以看一些代码吗?也许你对
-alertViewCancel的实现,以及处理你的警报视图的其他sn-ps(比如你第一次展示它的地方)。 -
好的。对不起,我忘记了。我现在编辑了我的问题。
标签: iphone methods delegates uialertview