Re: Proper NSOperation isCancelled handling
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