On May 15, 2012, at 2:50 PM, Jens Alfke wrote:

> Async NSURLRequest, as already mentioned. It’s a little bit clunky to use by 
> modern standards — I wish they’d add some nice block-based callbacks to it 
> instead of making me implement yet another delegate class — but it works 
> well, and it’s quite well documented by Apple and others.

I'd disagree regarding the "quite well documented by Apple" part.
Don't know about documentation by others.

Apple's doc has this bit of example code.

----------------
NSURLConnection *theConnection=[[NSURLConnection alloc] 
initWithRequest:theRequest delegate:self];
if (theConnection) {
    // Create the NSMutableData to hold the received data.
    // receivedData is an instance variable declared elsewhere.
    receivedData = [[NSMutableData data] retain];
} else {
    // Inform the user that the connection failed.
}
----------------

Is it possible for one of the delegate methods to be called before
receiveData is initialized?  The doc for initWithRequest:delegate: states

  This is equivalent to calling initWithRequest:delegate:startImmediately:
  and passing YES for startImmediately.

Sure looks like a possible race to me.  That disqualifies it as good
documentation.

Marc
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to