NSZombieEnabled FIXES my app?

▼魔方 西西 提交于 2019-12-01 23:00:14

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!