我有一个线程的连接,所以我将它添加到运行循环得到的所有数据:
[[NSRunLoop currentRunLoop] run];
[connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
但是,我找不到任何办法阻止它
- (void)connectionDidFinishLoading:(NSURLConnection *)connection{
if([NSRunLoop currentRunLoop]){
[[NSRunLoop currentRunLoop] cancelPerformSelectorsWithTarget:self];
}
[connection cancel];
}
我怎样才能阻止这个循环?