NSZombie 未登录到控制台
我的一个表视图出现 EXC_BAD_ACCESS 错误。我尝试将 NSZombieEnabled 键添加到可执行文件环境变量中。
屏幕似乎不再崩溃,但我没有从日志中收到任何消息来指示发生了什么
我做错了什么?
I am getting an EXC_BAD_ACCESS error on one of my table views. I have tried adding the NSZombieEnabled key to the executables environment variables.
It seems to be working in that the screen no longer crashes, but I do not get any messages from the log to indicate what's going on
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
NSZombieEnabled 仅捕获因过度释放对象而导致的崩溃,但 EXC_BAD_ACCESS 可能是由其他问题引起的。如果您没有收到僵尸警告,则崩溃是由其他原因引起的。
在表上,最常见的原因是行或节的索引错误,导致表询问向表提供数据的数据结构中不存在的位置处的数据对象。
NSZombieEnabled just catches crashes caused by over releasing objects but
EXC_BAD_ACCESS
can be caused by other issues. If you don't get a zombie warning, then the crash is arising from another source.On a table, the most common cause would be getting the indexes of rows or sections wrong causing the table to ask data objects at non-existant locations in the data structure that provides the data to the table.
正如 TechZen:指出的那样,
EXC_BAD_ACCESS
可能是由其他原因引起的,而不是过度释放对象(您本质上使用NSZombie
检查的内容)。尝试查看调试器并查看当出现异常时调试器停止在哪一行,因为它可能是任意数量的内存相关问题(越界错误、初始化等)。as TechZen: pointed out,
EXC_BAD_ACCESS
can be caused from other sources than over releasing objects (what you useNSZombie
to check for essentially). Try looking in the debugger and see what line the debugger stops on when you get the exception, because it can be any number of memory related issues (out of bounds errors, initialization, etc).