【发布时间】:2010-09-19 22:13:40
【问题描述】:
我有一种将文件保存到互联网的方法,它可以工作但速度很慢。然后我想让用户界面更流畅,所以我创建了一个 NSThread 来处理慢任务。
我看到如下错误列表:
_NSAutoreleaseNoPool(): Object 0x18a140 of class NSCFString autoreleased with no pool in place - just leaking
没有 NSThread,我这样调用方法:
[self save:self.savedImg];
并且我使用了以下使用NSThread来调用方法:
NSThread* thread1 = [[NSThread alloc] initWithTarget:self
selector:@selector(save:)
object:self.savedImg];
[thread1 start];
谢谢。
【问题讨论】:
标签: cocoa multithreading memory-management memory-leaks