Synchronous NSURLConnection methods from NSOperation

Suppose I have several NSOperation objects attached to a parallel queue.

As part of these NSOperations, I would call the synchronous method NSURLConnectionClass, sendSynchronousRequest ...so as not to spoil my code by tracking various connections from one delegate.

Apple says it sendSynchronousRequest ...will automatically create a separate thread with a start loop to track NSURLConnection delegate messages.

But I already have some additional threads (working inside NSOperation)! So the question is: if I have, say, 10 NSOperationobjects, and each of them calls a synchronous method NSURLConnection, will it create 10 more additional ("automatically created") threads with run cycles or will there be only one for all of them?

+3
source share
1 answer

Do not worry about the thread being created NSURLConnection. These are some internal details. I am sure that this is one global thread common to all instances NSURLConnection.

+1
source

Source: https://habr.com/ru/post/1787785/


All Articles