下面的代码在iOS 4和5中正常工作,但在iOS 6中使用EXC_BAD_ACCESS
崩溃。我很感激任何帮助解决它。这段代码被称为在UITableViewController
来处理我的应用程序的搜索逻辑:UINavigationController popViewControllerAnimated:在iOS 6中崩溃
CATransition *transition = [CATransition animation];
transition.duration = 0.3f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
transition.type = kCATransitionFade;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController popViewControllerAnimated:NO];
我添加的方式tableView
是类似的,调用时不会崩溃:
SearchTVC *searchTable = [[SearchTVC alloc] init];
searchTable.detailViewController = self.detailViewController;
CATransition *transition = [CATransition animation];
transition.duration = 0.3f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
transition.type = kCATransitionFade;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:searchTable animated:NO];
可能是什么问题?
* 编辑
有趣的是,如果我使用[self.navigationController popViewControllerAnimated:YES];
(YES
而不是NO
)的碰撞没有发生的。但是,这当然会破坏使用自定义流行动画的目的。
有关坠机的更多细节将有所帮助;我想起了http://stackoverflow.com/questions/11584607/how-to-prevent-crash-on-cancel-of-mfmailcomposeviewcontroller/11588677#11588677 –