IOS学习-报错误 Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2014-10-01 17:31
597 查看
环境:XCODE:5.0.2 IOS7模拟器
界面:使用storyboard 拖拽
简单应用:一个CoreData的CRUD用例。
界面如下图(一个UITableViewController 列表 查询和删除 选择UITableViewCell后显示详细页面 一个UIViewController 进行编辑或添加数据)
![](https://oscdn.geek-share.com/Uploads/Images/Content/202004/04/0b888d8c88bd310ed5a815d5c5b7b8ad.png)
TableViewController 点击 +号 Push跳转到 DetaiViewController;选择Cell后也Push到DetailViewController(identifier为:detailViewByCell)跳转
都用连线实现。
![](https://oscdn.geek-share.com/Uploads/Images/Content/202004/04/fd8733418634e3e991157c63b6ff22ec.png)
在页面跳转到的时候出现如上报错,导致 导航子视图可能损坏 。
根据错误信息在DetaiViewController里输出导航的子视图
NSLog(@"%@",self.navigationController.viewControllers);
输出:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202004/04/856ded2234a45a975e4fa91b0fca4291.png)
发现DetailViewController 有2个 很明显跳转的时候 出现问题
原因是UITableViewCell 在选择的时候 用连线的时候直接PUSH到了DetailViewController,
而在代码里也实现了跳转
[self performSegueWithIdentifier:@"detailViewByCell" sender:p];
去掉此处代码,至于需要传参可在prepareForSegue中传参
界面:使用storyboard 拖拽
简单应用:一个CoreData的CRUD用例。
界面如下图(一个UITableViewController 列表 查询和删除 选择UITableViewCell后显示详细页面 一个UIViewController 进行编辑或添加数据)
![](https://oscdn.geek-share.com/Uploads/Images/Content/202004/04/0b888d8c88bd310ed5a815d5c5b7b8ad.png)
TableViewController 点击 +号 Push跳转到 DetaiViewController;选择Cell后也Push到DetailViewController(identifier为:detailViewByCell)跳转
都用连线实现。
![](https://oscdn.geek-share.com/Uploads/Images/Content/202004/04/fd8733418634e3e991157c63b6ff22ec.png)
在页面跳转到的时候出现如上报错,导致 导航子视图可能损坏 。
根据错误信息在DetaiViewController里输出导航的子视图
NSLog(@"%@",self.navigationController.viewControllers);
输出:
![](https://oscdn.geek-share.com/Uploads/Images/Content/202004/04/856ded2234a45a975e4fa91b0fca4291.png)
发现DetailViewController 有2个 很明显跳转的时候 出现问题
原因是UITableViewCell 在选择的时候 用连线的时候直接PUSH到了DetailViewController,
而在代码里也实现了跳转
[self performSegueWithIdentifier:@"detailViewByCell" sender:p];
去掉此处代码,至于需要传参可在prepareForSegue中传参
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if ([segue.identifier isEqualToString:@"detailViewByCell"]) { TRDetailViewController* detailVC=[segue destinationViewController]; Person* p=self.persons[ [self.tableView indexPathForSelectedRow].row]; detailVC.editPerson=p; } }
相关文章推荐
- Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
- 最近经常碰到的问题 Navigation Bar subview tree might get corrupted
- iOS 导航栏错误 nested push animation can result in corrupted navigation bar
- IOS nested push animation can result in corrupted navigation bar . Unbalanced calls to begin/end
- UINavigationController出现nested push animation can result in corrupted navigation bar的错误提示
- 【iOS】返回崩溃:nested pop animation can result in corrupted navigation bar nested pop animation can re
- UINavigationController出现nested push animation can result in corrupted navigation bar的错误提示
- IOS学习之navigationBar上添加图片(UIImageView)以及文字(UILabel)
- [IOS问题]nested push animation can result in corrupted navigation bar
- [IOS问题]nested push animation can result in corrupted navigation bar
- Status bar and navigation bar appear over my view's bounds in iOS 7
- IOS错误: Unknown class UIFolderTableView in Interface Builder file.
- myeclipse非正常关闭,“Package Explorer”非正常显示,出现错误“Could not create the view: An unexpected exception was t
- 【iphone】返回崩溃:nested pop animation can result in corrupted navigation bar nested pop animation can re
- nested push animation can result in corrupted navigation bar
- Speed Up Your Site with the Improved View State in ASP.NET 2.0
- MyEclipse Servers视窗出现“Could not create the view: An unexpected exception was thrown”错误解决办法
- MyEclipse Servers视窗出现“Could not create the view: An unexpected exception was thrown”错误解决办法
- MyEclipse Servers视窗出现“Could not create the view: An unexpected exception was thrown”错误解决办法
- RDLC生成pdf文件“An unexpected error occurred in Report Processing”错误处理