Re: iOS app launching speed
Re: iOS app launching speed
- Subject: Re: iOS app launching speed
- From: Jens Alfke <email@hidden>
- Date: Tue, 15 May 2012 17:13:07 -0700
On May 15, 2012, at 3:33 PM, Marco S Hyman wrote:
> I'd disagree regarding the "quite well documented by Apple" part.
Have you read the URL Loading System guide, not just the class API docs?
> Is it possible for one of the delegate methods to be called before
> receiveData is initialized?
No. The delegate will only be called on the thread you created the NSURLConnection object on (as the class doc clearly says), and only via runloop callbacks, so there’s no way it can be called before you finish handling the current event.
I suppose it could conceivably call the delegate from within the -init method itself, but that would be rather strange behavior (I can’t think of any API that does this, since it means your delegate gets called before you even know the identity of the object calling it!) and moreover, the fact that Apple’s example shows things being done in this order implies that it’s safe.
> Sure looks like a possible race to me. That disqualifies it as good
> documentation.
So it’s bad documentation because it shows a race condition you thought up, even though the race condition doesn’t actually exist? O_o
—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