我的自动释放池正在随机地崩溃我的应用程序,这个问题的常见原因是什么?
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x0145ba63 objc_msgSend + 23
1 CoreFoundation 0x01210a6c CFRelease + 92
2 CoreFoundation 0x012f2e8a -[__NSArrayM dealloc] + 170
3 CoreFoundation 0x01210a6c CFRelease + 92
4 CoreFoundation 0x01235b8d _CFAutoreleasePoolPop + 237
5 Foundation 0x0005886c __NSFireDelayedPerform + 559
6 CoreFoundation 0x012dafe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
7 CoreFoundation 0x012dc594 __CFRunLoopDoTimer + 1220
8 CoreFoundation 0x01238cc9 __CFRunLoopRun + 1817
9 CoreFoundation 0x01238240 CFRunLoopRunSpecific + 208
10 CoreFoundation 0x01238161 CFRunLoopRunInMode + 97
11 GraphicsServices 0x01c2e268 GSEventRunModal + 217
12 GraphicsServices 0x01c2e32d GSEventRun + 115
13 UIKit 0x002e842e UIApplicationMain + 1160
14 FancyAPint 0x000029e8 main + 102 (main.m:14)
15 FancyAPint 0x00002979 start + 53我知道这是因为一个对象被过度释放了,我认为对象在自动释放池尝试释放之前就被释放了,这是正确的吗?因此,自动释放池试图过度释放对象?
发布于 2011-01-17 19:38:21
你的评估是正确的。尝试使用模拟器中的“僵尸”工具运行您的应用程序,或者将NSZombieEnabled环境变量设置为YES。这两个都将为您提供有关哪些对象正在被过度释放的更多信息。
发布于 2011-01-17 21:08:38
这将是因为额外的内存释放。不要释放在自动释放池中分配的对象,该对象是从具有自己内存的对象初始化的。这可能是背后的一个原因,因为我也面临这个问题。
https://stackoverflow.com/questions/4712658
复制相似问题