• 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: Proper NSOperation isCancelled handling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper NSOperation isCancelled handling


  • Subject: Re: Proper NSOperation isCancelled handling
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 13 Feb 2009 02:31:13 -0600

On Feb 12, 2009, at 1:29 PM, Alex Curylo wrote:

So I'm a bit confused about how my NSOperation subclass should implement the cancel method.

Why are you overriding it? The -cancel method is not supposed to actively bring the operation to a stop. It's only supposed to set a flag. The operation's work methods (-start, -main, and whatever they call) should be periodically checking the -isCancelled property and, if it's set, gracefully bring their work to an end.


Regards,
Ken

_______________________________________________

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


  • Follow-Ups:
    • Re: Proper NSOperation isCancelled handling
      • From: Alex Curylo <email@hidden>
References: 
 >Proper NSOperation isCancelled handling (From: Alex Curylo <email@hidden>)

  • Prev by Date: Re: Matching String With ObjectForKey?
  • Next by Date: Re: Garbage Collection and NSManagedObject
  • Previous by thread: Proper NSOperation isCancelled handling
  • Next by thread: Re: Proper NSOperation isCancelled handling
  • Index(es):
    • Date
    • Thread