Re: Proper NSOperation isCancelled handling
Re: Proper NSOperation isCancelled handling
- Subject: Re: Proper NSOperation isCancelled handling
- From: Alex Curylo <email@hidden>
- Date: Fri, 13 Feb 2009 05:55:02 -0800
On 13-Feb-09, at 12:31 AM, Ken Thomases wrote:
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.
Because all -start does is initiate an NSURLConnection. If it's
failing to connect or whatever, I want the operation to stop when the
user says so, not whenever -didFailWithError gets around to being
called.
--
Alex Curylo -- email@hidden -- http://www.alexcurylo.com/
"You definitely have some kind of Zen thing going for you."
-- Craig Joseph Huxtable
_______________________________________________
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