我正在开发我的线程在 connectionDidFinishLoading 时启动的应用程序。
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[downloadingthread cancel];
downloadingthread = [[NSThread alloc]initWithTarget:self selector:@selector(startusingthread) object:nil];
[downloadingthread start];
}
connectionDidFinishLoading 被多次调用,所以我想停止下载线程,然后再次启动它。我试图只执行最后一个线程。请帮助我在两者之间停止我的线程。