UINavigationController出现nested push animation can result in corrupted navigation bar的错误提示
今天在測试过程中,出现了这样一个bug。分别有两种情景:
(前提是:app是基于UINavigationController构建的)
1、从Controller-A中push进来B。在B中点击返回,返回的界面为黑色一片。再做返回操作就crash了。
如图1:
2、从Controller-A中push进入B,此时B中tableview出现错位现象(图2)。tableview被navigationbar覆盖了一部分,在B中再push一个C进来。
此时仅仅显示了C的navigationbar,但下方的view还是保留为B的view(图3)。
再进行返回操作,程序crash。
如图2:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2luZ19zaW5n/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">
图3:
崩溃后。查看控制台的log,发现这样一句话:
nested push animation can result in corrupted navigation bar
捣弄了好久,也找了资料,还是没办法解决。
后来在Controller-B中的viewdidload打印了navigationcontroller的全部压栈viewcontrollers,发如今B之前多了一个无关的viewcontroller-D,再检查代码。原来在点击A的cell的时候(didSelectRowAtIndexPath)push了一个D,但在storyboard上,对A的点击已经加了一个跳转到B的segue。正是因为同一时间push了两个controller进来,所以就会出现这种警告以及后面的奇怪错误。
将A中didSelectRowAtIndexPath位置的push代码去掉。再測试。问题全然攻克了。
纠缠了半天的bug,原来是一个小失误导致的。
因为整个项目是两个人一起做的,相互没沟通好或者没细致了解好结构就盲目写代码。终于仅仅会花费大量时间在debug上。此次教训须谨记啊。
UINavigationController出现nested push animation can result in corrupted navigation bar的错误提示的更多相关文章
- nested push animation can result in corrupted navigation bar
2013-12-06 10:15:51.668 CodingForFun[4569:70b] nested push animation can result in corrupted navigat ...
- nested pop animation can result in corrupted navigation bar
nested pop animation can result in corrupted navigation barFinishing up a navigation transition in a ...
- 转:UINavigationBar返回上一级出现nested pop animation can result in corrupted navigation bar
[self.navigationController popViewControllerAnimated:NO]; 出现上面的错误是因为pop的时候要确保先让本页面加载完成,即如果在viewDidLo ...
- Push to origin/master was rejected (Git提交错误)
[问题描述] 在使用Git Push代码的时候,会出现 Push to origin/master was rejected 的错误提示. 在第一次提交到代码仓库的时候非常容易出现,因为初始化的仓库和 ...
- Push to origin/master was rejected (Git提交错误)(转)
[问题描述] 在使用Git Push代码的时候,会出现 Push to origin/master was rejected 的错误提示. 在第一次提交到代码仓库的时候非常容易出现,因为初始化的仓库和 ...
- 使用JPA保存对象时报nested exception is javax.persistence.RollbackException: Transaction marked as rollbackOnly错误
使用JPA保存对象时报nested exception is javax.persistence.RollbackException: Transaction marked as rollbackOn ...
- git push时错误提示的解决办法 By default, updating the current branch in a non-bare repository error: is denied,
在使用git将客户端的修改push到服务器上的时候,出现无法push,提示和stackoverflow上的http://stackoverflow.com/questions/2816369/git- ...
- Swift 4.0.2 按下tab bar item时, item会有内缩的animation效果(如同Twitter的tab bar 效果一样)
先上效果图: 假设 tab bar items 有5个.tag为0,1,2,3,4.storyboard中tab bar controller继承的class叫做xxxVC. class xxxVC: ...
- Can't add self as subview的困惑
2016-05-27 09:40:43.4043 UMLOG: event: session_id=B63F36D84AD478B9F95C7D0F05DD819B, event=user_choos ...
随机推荐
- iOS图标抖动效果
开始抖动 -(void)BeginWobble { srand([[NSDate date] timeIntervalSince1970]); float rand=(float)random(); ...
- Commands to help you to Start Using ScaleIO Storage
To start using your storage: Log in to the MDM: scli --login --username admin --password <passwor ...
- 第一个手写Win32窗口程序
第一个手写Win32窗口程序 一 Windows编程基础 1 Win32应用程序的基本类型 1.1 控制台程序 不需要完善的Windows窗口,可以使用DOS窗口 的方式显示. 1.2 Win32窗口 ...
- 为什么static数据成员一定要在类外初始化?(转)
1.避免重复定义和初始化 <<c++ primer>>说在类外定义和初始化是保证static成员变量只被定义一次的好方法. 但,为什么static const int就可以在类 ...
- map练习
/* 编写程序统计并输出所读入的单词出现的次数 */ /* //代码一:---用map索引实现惊人的简练 #include <iostream> #include <map> ...
- 双数组Trie树(DoubleArrayTrie)Java实现
http://www.hankcs.com/program/java/%E5%8F%8C%E6%95%B0%E7%BB%84trie%E6%A0%91doublearraytriejava%E5%AE ...
- jquery操作select(取值,设置选中)(转)
http://www.cnblogs.com/liaojie970/p/5210541.html 比如<select class="selector"></sel ...
- Spring(八):Spring配置Bean(一)BeanFactory&ApplicationContext概述、依赖注入的方式、注入属性值细节
在Spring的IOC容器里配置Bean 配置Bean形式:基于xml文件方式.基于注解的方式 在xml文件中通过bean节点配置bean: <?xml version="1.0&qu ...
- 上机题目(0基础)- Java网络操作-打印网页(Java)
打印一个网页,熟悉Java网络编程: import java.io.BufferedReader; import java.io.IOException; import java.io.InputSt ...
- MySQL表级锁和行级锁
一:概述 相对其他数据库而言,MySQL的锁机制比较简单,其最显著的特点是不同的存储引擎支持不同的锁机制.比如,MyISAM和MEMORY存储引擎采用的是表级锁(table-level locking ...