iphone - XCode Instruments - 分配仪器未找到僵尸

标签 iphone ios xcode ios5 nszombie

我正在运行 Xcode 4.4.1 并构建一个 iOS 应用程序。我的应用崩溃了并且存在内存问题(我知道是因为它在 objc_msgSend 上崩溃)。

所以我正在运行 Zombies Instruments 工具。问题是,它运行时没有错误,并且对我的僵尸没有任何帮助:

No Zombies found, no crashes

如果我关闭僵尸检测,那么程序就会崩溃。我是否错误地使用了 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/

相关文章:

ios - Ionic 应用程序覆盖 iOS 9.1 中的 iPhone 状态栏

xcode - 当用户在 webkit 中没有互联网连接时加载新 View

iphone - 游戏中心细节

iphone - 使用 AVMutableAudioMix 调整 Assets 内轨道的音量

iphone - OpenGL ES 2.0 纹理对象的多个实例

ios - iOS 13 "canOpenURL: failed for URL: “fbauth2:///” 的 Facebook 登录套件“

ios - 如何在 Cordova 中压缩(压缩)SQLITE 数据库文件?

iPhone IOS5 Storyboard,如何加载带有自定义 .xib 文件的 UIViewController?

ios - 将 UIImageView 添加到 UIScrollView

xcode - 有没有办法要求 Xcode Cloud 工作流程通过才能合并 GitHub Pull Request?