Re: handleGetURLEvent getting called after applicationDidFinishLaunching
Re: handleGetURLEvent getting called after applicationDidFinishLaunching
- Subject: Re: handleGetURLEvent getting called after applicationDidFinishLaunching
- From: Jens Alfke <email@hidden>
- Date: Tue, 27 Aug 2013 09:32:41 -0700
On Aug 27, 2013, at 7:24 AM, Bradley O'Hearne <email@hidden> wrote:
> So switching to iOS for a moment, things like location services callbacks, NSURLConnection callbacks, animation completion handlers, accelerometer and touch events -- all main thread? (I'm pretty sure a few of those aren't main thread, but asking just the same -- I'm not sure that detail is actually in the API doc for all of them.
NSURLConnection's callbacks are invoked on whatever thread/runloop you started the connection on. (Unless you explicitly schedule it in a different runloop or dispatch queue.) It’s perfectly fine to run it on a background thread. The docs explain this.
The same goes for other I/O stuff like NSStream or CFStream. A good clue is that if the API has a method like -scheduleInRunloop: or -setDelegateQueue:, it supports background threads.
The API docs are generally good about explaining the threading of callbacks. If they don’t say anything, assume main thread.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden