问题描述
- 普通viewcontroller 模态视图present到tabbarcontroller无法dismiss的问题
-
我有个登陆界面viewcontroller,然后通过模态视图present到一个tabbarcontroller,然后dismiss就crash掉。然后我尝试present到一个普通的viewcontroller,在里面新建tabbarcontroller的对象,添加view,然后再通过设置代理在viewcontroller中dismiss依然还是无用,求大神指点
而且每次报错都是这边 “0x124909b: movl 8(%edx), %edi”没有提示错误
解决方案
你是说你tabbar dismiss回登录界面时候会crash掉? 还是?
一般来说估计是dismiss回去的时候有些instance被错误释放?导致draw的时候exc bad access? 这类问题比较烦人,你择Product->Edit Schema, 选择Run (App Name), 在Arguments下面的Environment Variables中,添加NSZombieEnabled, Value值为YES 。看看具体是哪里的问题
解决方案二:
因为没看你代码,我猜是你present后,吧self.windows.rootViewControll 重新设置了下,这样你的原viewController,应该被释放了,于是你dismiss 就crash了,纯猜的。本人小白一个。
时间: 2024-08-23 00:28:30