OBJ-C,释放对象的校验和不正确-释放对象后可能已修改该对象 [英] Obj-c, incorrect checksum for freed object - object was probably modified after being freed

查看:64
本文介绍了OBJ-C,释放对象的校验和不正确-释放对象后可能已修改该对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到此错误

malloc: * * * error for object 0x8a591d4: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
No memory available to program now: unsafe to call malloc
No memory available to program now: unsafe to call malloc

它来自此行

NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Info" 
       ofType:@"plist"];
NSData *plistData = [NSData dataWithContentsOfFile:plistPath];
NSDictionary *loadedPlist = 
[NSPropertyListSerialization  propertyListFromData:plistData 
       mutabilityOption:0 format:NULL errorDescription:NULL]; <<< this line

plistData的值设置为摘要不可用

The value of plistData is set to Summary Unavailable

我不确定从哪里开始?

编辑-添加了更多代码

推荐答案

我要添加另一个答案:还可能已经用软管清理了堆,并且对propertyListFromData失败了:仅仅是因为它做了很多事情的分配,碰巧碰到了坏处。因此,请在Xcode中编辑方案,并确保已选中所有内存管理项(在运行任务的诊断选项卡中)。

I'm going to add another answer: it's also possible that you have ALREADY hosed the heap, and you're failing on propertyListFromData: just because it does a lot of allocations and happens to hit the bad spot. So edit your scheme in Xcode, and make sure you have all of the Memory Management items checked (in the Diagnostics tab of the Run task).

这篇关于OBJ-C,释放对象的校验和不正确-释放对象后可能已修改该对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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