nsautoreleasenopool专题

*** __NSAutoreleaseNoPool(): Object 0x6013810 of class __NSArrayI autoreleased with no pool in place

被这个问题折腾了一夜,终于找到原因了。 网上大部分人说的是当perforSelectorInBackground线程里时,不要忘记手动 添加autoreleasepool(如何添加请参见main。m) 我犯的错误是定义了全局变量 NSArray *gFiles = [NSArray arrayWithObjects:@"xxx",@"xxx",@"xxx", nil];