I noticed that if I create an NSURLConnection and run the query, everything will be fine. My delegate methods are called, and the last delegate method is called well after the code that invokes the connection has completed. Excellent.
This makes me think that connections are asynchronous, which implies that they are multithreaded. It's right? Can they be asynchronous, but in the same thread? No, this is crazy - right?
But in every example I saw with NSOperation, NSURLConnections are always scheduled by InRunLoop, after which [runLoop runMode ...] is called in a while loop.
Can someone explain what is going on here? It seems to me that the first case requires spawning of secondary threads, but there is no manual call of the execution loop (in these threads), while NSOperation (in the new thread) requires manual calling of the execution loop.
Why in the first case does not require a manual call?
source share