NSZombieEnabled FIXES我的应用程序? [英] NSZombieEnabled FIXES my app?

查看:182
本文介绍了NSZombieEnabled FIXES我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我推一个特定的视图控制器,然后去弹出它,然后重复一个看似随机的次数的应用程序最终崩溃与错误EXC_BAD_ACCESS。



可以可靠地复制每次。它主要发生在第二次我弹出视图控制器,但有时它可以是第三或第四。



所以我决定设置NSZombieEnabled看到的问题是什么。



但是启用了此功能后,无法复制崩溃。所有这些改变是我检查在NSZombieEnabled在我的活动可执行文件的配置中的框和应用程序完美地工作。



任何想法是什么导致这?

感谢

解决方案

它会抛出一个EXC_BAD_ACCESS当我弹出一个特定的视图控制器,但一旦NSZombieEnabled打开,错误消失了。



为了缩小它,我注释掉所有的版本在弹出的视图控制器的dealloc,它保持应用程序崩溃,然后取消注释它们一次一个,直到它崩溃,显示有问题的变量。



在我的case ,它实际上是变量的释放语句本身,抛出的EXC_BAD_ACCESS



我不能告诉你到底如何解决它从其他,而不是不释放。我能够得到它工作正常后扭曲和清洗的代码,但是当我尝试回滚的更改,以再次获得错误,缩小精确的修复,我无法复制的问题。我实际上在第一次回滚,但从来没有。



这不是一个正确的答案,但也许会指向一个正确的方向。


When I push a certain view controller, then go pop it and then repeat a seemingly random number of times the app eventually crashes with the error EXC_BAD_ACCESS.

This I can reliably replicate EVERY TIME. It happens mostly the second time I pop the view controller, but sometimes it can be the third or fourth.

So I decided to set NSZombieEnabled to see what the problem was.

But with this enabled the crash can't be replicated. All thats changed is I check the box next to "NSZombieEnabled" in my active executable's config and the app works perfectly.

Any ideas what is causing this?

Thanks

解决方案

I had this same problem with an iPhone app in simulator. It would throw an EXC_BAD_ACCESS when I popped a particular view controller but as soon as NSZombieEnabled was on, the error vanished.

To narrow it down, I commented out all the releases in the popped view controller's dealloc, which kept the app from crashing, and then uncommented them one at a time until it crashed again, revealing the offending variable.

In my case, it was actually the variable's release statement itself that was throwing the EXC_BAD_ACCESS

I can't tell you exactly how to fix it from there other than to not release. I was able to get it working fine after tweaking and cleaning the code but when I try to roll back the changes to get the error again and narrow down the precise fix, I was unable to replicate the problem. I actually got it on the first roll back but never again. Maybe there's something environmental at work?

This isn't an answer exactly but maybe it'll point someone in the right direction.

这篇关于NSZombieEnabled FIXES我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆