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 protected])

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

This email sent to [email protected]

Reply via email to