有人能告诉我为什么这个代码在4.3模拟器上发送到实例的SIGABRT无法识别的选择器崩溃,但在iOS 5模拟器上运行得很好吗?
matchSetup = [[viewMatchSetup alloc]initWithNibName:@"viewMatchSetup" bundle:nil];
[matchSetup setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentViewController:matchSetup animated:YES completion:NULL];
提前致谢
FIX:[self presentModalViewController:matchSetup animated:YES]; //模态是必需的更改
答案 0 :(得分:12)
崩溃是因为iOS 4.3上没有presentViewController:animated:completion:
的{{1}}方法。它是在iOS 5中引入的。由于您不使用完成块,只需使用“旧”方法UIViewController
:
presentModalViewController:animated: