Re: SSL NSURLConnection to fake-cert server?
Re: SSL NSURLConnection to fake-cert server?
- Subject: Re: SSL NSURLConnection to fake-cert server?
- From: Jens Alfke <email@hidden>
- Date: Tue, 20 Mar 2012 11:32:50 -0700
On Mar 20, 2012, at 11:16 AM, Rick Mann wrote:
> I had written a fairly elaborate wrapper around the delegate-based API so I could use blocks in a way similar to what the new call provides.
> It also returned the NSURLConnection object, and allowed canceling of a request. But I always felt like it was messy and possibly contained bugs; I was pretty happy to see Apple add their API (even if I couldn't use it to cancel a request). I just wish they'd thought it through a bit more.
Yeah, I don’t think there’s a full equivalent of the delegate API yet. And if you think about it, there are a number of different calls to app code that the connection needs to make, so a block-based equivalent would have to have several different blocks you could configure for different tasks. At that point you’ve created the moral equivalent of a class anyway, as illuminated in the famous koan[1], so it seems cleaner to use a real class to express it.
—Jens
[1] http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html
_______________________________________________
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