我有这个在我的main.m:iPhone _NSAutoreleaseNoPool()的问题
printf("make autorelease pool \n");
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, @"UIApplication", @"MyAppDelegate");
[pool release];
return retVal;
我突然开始觉得这个时候我在模拟器上运行我的应用程序:
2010-08-27 11:09:35.909 MyApp[6224:207] *** _NSAutoreleaseNoPool(): Object 0x49107c0 of class NSPathStore2 autoreleased with no pool in place - just leaking
堆栈:( 0xe171f 0x58d64 0x59ebd 0x599ee 0x600c7 0x31d016 0x23198 0x29e94ae 0x29e97c4 0x29ee7c4 0x8fe036c8 0x8fe0d30a 0x8fe0d3d1 0x8fe024a9 0x8fe07950 0x8fe018b1 0x8fe01057)
2010-08-27 11:09:35.911 MyApp的[6224:207] *** _NSA utoreleaseNoPool():对象0x49110c0类NSPathStore2自动释放与地方没有游泳池 - 刚刚泄露 堆栈:(0xe171f 0x58d64 0x5cd69 0x60335 0x601f1 0x31d016 0x23198 0x29e94ae 0x29e97c4 0x29ee7c4 0x8fe036c8 0x8fe0d30a 0x8fe0d3d1 0x8fe024a9 0x8fe07950 0x8fe018b1 0x8fe01057)
2010-08-27 11 :09:35.912 MyApp的[6224:207] *** _NSAutoreleaseNoPool():对象0x4911ce0类NSPathStore2自动释放与地方没有游泳池 - 刚刚泄露 堆栈:(0xe171f 0x58d64 0x6902e 0x445545 0x23198 0x29e94ae 0x29e97c4 0x29ee7c4 0x8fe036c8 0x8fe0d30a 0x8fe0d3d1 0x8fe024a9 0x8fe07950 0x8fe018b1 0x8fe01057 ) 使autorelease池
有没有人有任何想法是什么导致t他? 任何帮助非常感谢!
好侦探工作。这是行为的原因:http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/doc/uid/20000050-load – 2010-08-27 11:19:00