• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6? (From: Steven Degutis <email@hidden>)
 >Re: Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6? (From: Ken Thomases <email@hidden>)
 >Re: Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6? (From: Steven Degutis <email@hidden>)

  • Prev by Date: Re: KVO: when to stop observing?
  • Next by Date: Re: Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6?
  • Previous by thread: Re: Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6?
  • Next by thread: Re: Async NSURLConnection + Concurrent NSOperation = Not possible under Mac OS X 10.6?
  • Index(es):
    • Date
    • Thread