我有这段简单的代码:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Contact" message:@"This contact does not exist yet" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:@"Not now", nil];
[alert show];
如果我将委托设置为“nil”,一切都很好。但是,如果我将委托设置为“self”并添加 clickedButtonAtIndex 或 didDismissWithButtonIndex 委托,则应用程序会因 EXC_BAD_ACCESS 而崩溃