0
我有这样的代码:NSAutoreleasepool泄漏 - 不明白为什么?
NSNumber *num;
NSAutoreleasePool *apool = [[NSAutoreleasePool alloc] init];
for (int i=0; i<images_count; i++) {
num = [NSNumber numberWithInt:images_count];
[self performSelectorInBackground:@selector(loadData:) withObject:num];
}
[apool release];
[num release];
和它生成以下错误:
2011-06-17 03:10:30.768 CHARLIE [2456:6c03] * __NSAutoreleaseNoPool():对象0x703d0f0类__NSArrayI autoreleased没有到位的地方 - 只是漏水
我不明白为什么它泄漏,请有人请解释如何解决这个问题?
非常感谢,
杰克
我不知道你为什么要在这种情况下创建一个自动释放池。有没有特别的原因? – sosborn 2011-06-17 02:19:42