PresentViewController在iOS 4.3上崩溃,但在iOS 5上没有
发布时间:2020-12-14 17:15:32 所属栏目:百科 来源:网络整理
导读:任何人都可以告诉我为什么这个代码崩溃与SIGABRT无法识别的选择器发送到实例,在4.3模拟器上,但在iOS 5模拟器上工作得很好? matchSetup = [[viewMatchSetup alloc]initWithNibName:@"viewMatchSetup" bundle:nil];[matchSetup setModalTransitionStyle:UIMod
任何人都可以告诉我为什么这个代码崩溃与SIGABRT无法识别的选择器发送到实例,在4.3模拟器上,但在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]; //模态是必需的更改 解决方法
它崩溃了,因为iOS 4.3上没有UIViewController的presentViewController:animated:completion:方法.它是在iOS 5中引入的.既然你没有使用完成块,只需使用“old”方法presentModalViewController:animated ::
[self presentModalViewController:matchSetup animated:YES]; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |