1
我有一个iphone应用程序,它运行一些线程来计算搜索。搜索是从库中调用一个耗时的函数。当应用程序终止时NSThread退出
我需要退出线程,当应用程序正在终止,否则线程继续运行和搜索创建问题,当我重新打开应用程序。
我试图在线程
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(mainApplicationWillTerminate) name:@"UIApplicationWillTerminateNotification" object:nil];
而且在mainApplicationWillTerminate
-(void)mainApplicationWillTerminate;
{
[NSThread exit];
}
问题认购依然存在,任何想法?
在右侧缺少“]” if语句 – 2009-07-13 09:59:53