Re: Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6?
Re: Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6?
- Subject: Re: Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6?
- From: "Adam R. Maxwell" <email@hidden>
- Date: Sun, 30 Aug 2009 09:10:30 -0700
On Aug 30, 2009, at 8:29 AM, Steven Degutis wrote:
So, the idea here was basically to create an NSOperation subclass
that could
deal with dependencies, and fit inside an NSOperationQueue (for
plenty of
reasons), which used the async methods for getting HTTP data. However,
either removing NSOperation as the superclass, or requiring it be
run on
+mainQueue both defeat the purpose of this class's flexibility, so
it seems
like it would be a step backwards.
You can do this by running the runloop yourself during the download,
and checking isCancelled for the operation. I did this using
NSURLDownload to fit exactly the scenario you're talking about
(cancellation and an existing NSOperationQueue-based setup). Code is
here (BSD license):
http://code.google.com/p/mactlmgr/source/browse/trunk/TLMInfraUpdateOperation.m
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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