有人看到有什么问题吗?我有一个UIAltertView但是当我点击任何两个按钮得到一个EXC_BAD_ACCESS:无法让UIAlert工作
UIAlertView *alert = [[UIAlertView alloc] init];
[alert setTitle:@"First Sync"];
[alert setMessage:@"The App is going to do its first synchronisation. This might take a few moment..."];
[alert setDelegate:self];
[alert addButtonWithTitle:@"OK"];
[alert addButtonWithTitle:@"Cancel"];
[alert show];
[alert release];
,并搭上了回应:
#pragma mark UIAlertView
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != 0)
{
NSLog(@"TEST1");
return;
}
NSLog(@"TEST2");
}
它必须是简单的东西...
当您显示警报时会发生什么?警报的代表是否有可能被释放? (尝试使用NSZombiesEnabled运行) – Vladimir 2011-02-13 18:03:17