1.self.navigationController = nil
2.沒有在主線程
3.現(xiàn)象:界面卡主二鳄,退到后臺再返回前臺發(fā)現(xiàn)已經跳轉赴涵,但之后push和pop會異常。原因:在第一個控制器觸發(fā)了側滑手勢订讼。在第一個控制器添加如下代碼可以解決:
- (void)viewDidAppear:(BOOL)animated {
? ? [superviewDidAppear:animated];
? ? self.navigationController.interactivePopGestureRecognizer.enabled =NO;
}
- (void)viewWillDisappear:(BOOL)animated
{
? ? [superviewWillDisappear:animated];
? ? // 開啟返回手勢
? ? if([self.navigationControllerrespondsToSelector:@selector(interactivePopGestureRecognizer)]) {
? ? ? ? self.navigationController.interactivePopGestureRecognizer.enabled =YES;
? ? }
}