我正在开发的应用程序在 iPhone 上运行时不断崩溃,但在模拟器上却没有(尽管在没有符号 malloc_error_break 的情况下运行时会显示警告,但应用程序会继续在 Sim 上运行)
我没有手动释放任何字符串,而是使用:
[[[NSString / NSMutableString alloc] init] autorelease];
(我一直在为其他应用程序做这件事,从来没有给我带来问题)
现在,当我将 malloc_error_break 设置为断点时,我得到:
2012-03-07 17:04:06.072 columns[15487:f803] *** -[CFString release]: message sent to deallocated instance 0x68c8210
随着 XCODE4 跳转到:
int main(int argc, char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate"); >>> Thread 1
[pool release];
return retVal;
}
在模拟器上运行时我也有 NSZombieEnabled
如果有人可以帮助我如何在 XCODE 4 上进行调试,或者将我指向一个在线教程,将不胜感激!
问候
大卫