在我的 iPhone 应用程序中,在调用任何代码之前,我在应用程序一开始就在控制台中收到了三个奇怪的警告:
*** __NSAutoreleaseNoPool(): Object 0x84be00 of class NSCFString autoreleased with no pool in place - just leaking
*** __NSAutoreleaseNoPool(): Object 0x84b000 of class NSCFString autoreleased with no pool in place - just leaking
*** __NSAutoreleaseNoPool(): Object 0x849c00 of class NSCFString autoreleased with no pool in place - just leaking
我在许多地方使用 MBProgressHUD 来显示进度指示器,这是关于此问题的其他一些讨论所指出的,因为它在显示进度指示器时会引发一个新线程。但最奇怪的是,这些似乎甚至在我的 main() 函数开始之前就被抛出了:
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
当我在我的代码中的第一个断点时NSAutoreleasePool
,甚至在该行运行之前,我都会收到此警告。假设在此之前我没有运行任何我自己的代码,可能导致错误的原因是什么?