If you have a class that uses NSURLConnectionDataDelegate and does asynchronous work via the NSURLConnectionDataDelegate methods
1 2 3 4 |
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response; - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data; - (void)connectionDidFinishLoading:(NSURLConnection *)connection; ....etc |
do not pair it with GCD because it itself is a separate worker thread that does the connections for you. Hence use NSURLConnection async by itself.
If you use NSURLConnection sync version, then you can use it with GCD.