下面的代码在 iOS 4 和 5 中运行良好,但在带有EXC_BAD_ACCESS
. 我将不胜感激任何帮助解决它。UITableViewController
此代码在处理我的应用程序的搜索逻辑中被调用:
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
) ,则不会发生崩溃。但这当然违背了使用自定义弹出动画的目的。