使用box2d的奇怪xcode错误
问题描述:
即时通讯使用xcode4和box2d/cocos2d。使用box2d的奇怪xcode错误
我有一些奇怪的困难与运行时错误,随机弹出。
我认为他们发生更多的时候,我不会停止重建/运行前的过程。
通常,如果我停止过程之前我重建/运行错误不会发生。
有时我得到一个:
'NSInvalidArguementException', reason '-[ConstructLayer createCog:::]: unrecognized selector sent to instance 0x554ecd0.
有时候我在一个文件中一个奇怪的错误叫:
llvm:InstCombiner::DoOneIteration(llvm::Function&, unsigned int)_disassembly_0x026bc64f.nasm
与行强调:
0x02bc64f <+0439> mov 0x20(%eax),%ecxn
And sometimes i get an error: malloc * error for object 0x68d4ba4: incorrect checksum for freed object - object was probably modified after being freed.
这里是我的dealloc方法:
- (void) dealloc{
delete world;
world = NULL;
body_block1 = NULL;
body_egg = NULL;
body_poly = NULL;
[_block1 release];
[_egg release];
[_poly release];
[super dealloc];
}
究竟发生了什么?通常错误在连续发生三次,并且在重新开始运行之前发生错误。
帮助!
谢谢,
奥利弗。
答
尝试在释放它之后创建一个数组nil。
[_block1 release];
_block = nil;
[_egg release];
_egg = nil;
[_poly release];
_poly = nil;