下面的代碼在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 –