Re: NSStream only knows runloops, NSURLSession only knows operation queues
Re: NSStream only knows runloops, NSURLSession only knows operation queues
- Subject: Re: NSStream only knows runloops, NSURLSession only knows operation queues
- From: Jens Alfke <email@hidden>
- Date: Tue, 22 Jul 2014 08:11:57 -0700
On Jul 22, 2014, at 1:53 AM, Quinn The Eskimo! < email@hidden> wrote:
A. stick with run loops -- In that case you can use your own private queue as NSURLSession's delegate queue and have it bounce over to the run loop via -performSelector:onThread:xxx.
Yeah, this sounds like the most practical solution, especially since it requires changing the least amount of code. Thanks! B. move to queues -- NSStream does support queues for its delegate callback, just not via the Cocoa API. Check out CF{Read,Write}StreamSetDispatchQueue. These will work with NSStream due to the magic of toll free bridging.
Good to know, except that to use this I’d need the NSOperationQueue.underlyingQueue property, which has just been added for iOS 8 … meaning I probably won’t get to use it for another year or so.
—Jens |
_______________________________________________
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