Re: NSURLConnection dependency on RunLoop (Sanity check)
Re: NSURLConnection dependency on RunLoop (Sanity check)
- Subject: Re: NSURLConnection dependency on RunLoop (Sanity check)
- From: j o a r <email@hidden>
- Date: Thu, 21 Jul 2005 23:28:30 +0200
On 21 jul 2005, at 21.23, Andrei Tchijov wrote:
NSURLConnection when used in asynchronous mode
( initWithRequest:delegate: ) starts couple threads to deal with
actual IO but also register some inputs with RunLoop of the thread
which created it. As a result, nothing will happen with such
connection until that RunLoop had a chance to "run" (at least none
of delegate methods are going to be invoked).
That sounds about right.
The way I solved this problem (feature) is by creating new thread
each time I need to use NSURLConnection. Is there a better way?
What is your main thread doing? Why is it so busy? Usually you try to
keep the main thread idle as much as possible, to allow it to be
responsive to user events. But perhaps you're talking about some sort
of command line utility?
Yes, you *could* of course solve the problem with a second thread,
but it kind of defeats the whole purpose of this design. The point is
that you shouldn't have to set up these extra threads yourself, and
figure out how to communicate between them.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden