NSURLConnection synchronous request from stream to asynchronous request

What is the difference between adding an operation that makes a synchronous request NSURLConnection to NSOperationQueue (or a synchronous request from a stream (not the main stream)) and makes an asynchronous request from the main stream?

Both will not block the main thread, so the user interface will remain responsive, but are there any advantages to using one over the other? I know that in a later method, I can track the progress of the request, etc., but I guess that progress and other HTTP files are not important here.

+5
source share
3 answers

, , , ( ).

, NSThread, , .

NSURLConnection, , cancel.

, API, NSOperationQueue (+sendAsynchronousRequest:queue:completionHandler:), GCD dispatch_source_create, - , , NSURLConnection , ( WWDC'12, , , ), , , .

, NSURLConnection API (. OHURLLoader github), ( ). , API, NSOperationQueue, , runloop, .

+2

. , . . , , , . NSURLConnections NSThread, . , , JSON/XML/image , .

+5

, , , , - , -.

+2

All Articles