Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: NSURLConnection's scheduleInRunLoop:forMode: not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLConnection's scheduleInRunLoop:forMode: not working



Please file a bug.  Either the docs or the behavior should definitely change.  I don't know if anyone ever tested this :)


On Aug 9, 2011, at 10:55 AM, Jens Alfke wrote:


On Aug 9, 2011, at 10:49 AM, Mark Pauley wrote:

I'm positive that I've never seen anyone trying to use NSURLConnection like that before.  The NSURLConnection probably ignores any scheduleInRunLoop calls that come after it's been started.

Thanks for confirming my fears! But someone should update the docs, then:

scheduleInRunLoop:forMode:

Discussion
At creation, a connection is scheduled on the current thread (the one where the creation takes place) in the default mode. That can be changed to add or remove runloop + mode pairs using the following methods. It is permissible to be scheduled on multiple run loops and modes, or on the same run loop in multiple modes, so scheduling in one place does not cause unscheduling in another.
You may call these methods after the connection has started. However, if the connection is scheduled on multiple threads or if you are not calling these methods from the thread where the connection is scheduled, there is a race between these methods and the delivery of delegate methods on the other threads. The caller must either be prepared for additional delegation messages on the other threads, or must halt the run loops on the other threads before calling these methods to guarantee that no further callbacks will occur.

—Jens

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSURLConnection's scheduleInRunLoop:forMode: not working (From: Jens Alfke <email@hidden>)
 >Re: NSURLConnection's scheduleInRunLoop:forMode: not working (From: Mark Pauley <email@hidden>)
 >Re: NSURLConnection's scheduleInRunLoop:forMode: not working (From: Jens Alfke <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.