我正在运行 Xcode 4.4.1 并构建一个 iOS 应用程序。我的应用崩溃了并且存在内存问题(我知道是因为它在 objc_msgSend
上崩溃)。
所以我正在运行 Zombies Instruments 工具。问题是,它运行时没有错误,并且对我的僵尸没有任何帮助:
如果我关闭僵尸检测,那么程序就会崩溃。我是否错误地使用了 Zombie 工具?或者这是否表明我有不同的问题?
无用的堆栈跟踪如下...
#0 0x0212a09b in objc_msgSend ()
#1 0x01bd36b7 in -[NSError dealloc] ()
#2 0x0212ae3d in _objc_rootRelease ()
#3 0x01bc1f28 in -[NSFilesystemItemRemoveOperation dealloc] ()
#4 0x01bb0e16 in -[NSOperation release] ()
#5 0x0212ae00 in objc_release ()
#6 0x0212bc50 in (anonymous namespace)::AutoreleasePoolPage::pop(void*) ()
#7 0x004faea8 in _CFAutoreleasePoolPop ()
#8 0x004fd80b in __CFRunLoopRun ()
#9 0x004fcd84 in CFRunLoopRunSpecific ()
#10 0x004fcc9b in CFRunLoopRunInMode ()
#11 0x02ca57d8 in GSEventRunModal ()
#12 0x02ca588a in GSEventRun ()
#13 0x0127a626 in UIApplicationMain ()
#14 0x00002e5d in main at /Users/willentriken/Developer/EnglishStudy/EnglishStudy/main.m:16
#15 0x00002dc5 in start ()
最佳答案
iOS 6.0 之前的版本(以及 Mac OS 10.8 之前的版本)中的 ARC 和 NSZombieEnabled 下存在一个错误,该错误会阻止自动释放实例变量和属性。
这解释了你所看到的,因为对象只会泄漏而不是变成僵尸。
解决方案:在iOS 6.0下测试。
附加信息:在 5.1 模拟器中测试时,在 Mountain Lion 下问题仍然存在。
关于iphone - XCode Instruments - 分配仪器未找到僵尸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12132325/