ara*_*ank 10 uialertview ios automatic-ref-counting
这是我如何显示UIAlertView和委托clickedButtonAtIndex -
UIAlertView *alert =
[[UIAlertView alloc] initWithTitle: @"title"
message: @"message"
delegate: self
cancelButtonTitle: @"Cancel"
otherButtonTitles: @"Continue", nil];
[alert show];
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
//something
}
Run Code Online (Sandbox Code Playgroud)
这段代码在没有ARC的情况下完美运行.但是使用ARC它会抛出此错误 - 由于未捕获的异常'NSInvalidArgumentException'终止应用程序,原因:' - [__ NSCFType alertView:clickedButtonAtIndex:]:无法识别的选择器发送到实例0x859d790'
关于代表为何抛出此错误的任何想法?
| 归档时间: |
|
| 查看次数: |
4522 次 |
| 最近记录: |