当我执行以下操作时:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, NULL), ^{
create NSURLRequest;
create NSURLConnectionDelegate;
create NSURLConnection;
start NSURLConnection;
});
委托的方法永远不会被调用。但是当我这样做时
dispatch_async(dispatch_get_main_queue(), ^{
create NSURLRequest;
create NSURLConnectionDelegate;
create NSURLConnection;
start NSURLConnection;
});
他们确实会被叫到。为什么?
UPD
http://developer.apple.com/library/ios/#qa/qa1712/_index.html
现在我创建了 NSURLConnection;启动 NSURLConnection;在主线程上。