Re: NSURLSessionTasks don't have their own delegates?!
Re: NSURLSessionTasks don't have their own delegates?!
- Subject: Re: NSURLSessionTasks don't have their own delegates?!
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Tue, 22 Jul 2014 17:20:22 +0100
On 22 Jul 2014, at 17:09, Shawn Erickson <email@hidden> wrote:
> In my experience you just create multiple session objects per thing needing tasks executed.
That's not the way the API was intended to be used. The idea is to use your session object to group your requests logically. For example, this makes it easy to set your user agent string in one place.
There are situations where I've needed to explicitly demultiplex the NSURLSession delegate callbacks but in general I've found that I like having the delegate callbacks funnelled into one place. In my experience my app already has an object that it's using to track a particular request but only a small subset of the actual NSURLSession delegate callbacks need to make it to that object. For example, I typically want to centralise my handling of authentication challenges.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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