• 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: Kyle Sluder <email@hidden>
  • Date: Fri, 13 Feb 2009 11:23:09 -0500

On Fri, Feb 13, 2009 at 8:55 AM, Alex Curylo <email@hidden> wrote:
> 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.

That's not what -cancel is supposed to do.  -cancel is simply a way to
get -isCancelled to return YES.  You check for this at the top of your
thread's runloop, and if it is YES then you abort your operation and
end the thread.

--Kyle Sluder
_______________________________________________

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: Ken Heglund <email@hidden>
References: 
 >Proper NSOperation isCancelled handling (From: Alex Curylo <email@hidden>)
 >Re: Proper NSOperation isCancelled handling (From: Ken Thomases <email@hidden>)
 >Re: Proper NSOperation isCancelled handling (From: Alex Curylo <email@hidden>)

  • Prev by Date: Re: How do I make one thread wait until another thread exits?
  • Next by Date: Re: System Preferences "halo/spotlight" effect
  • Previous by thread: Re: Proper NSOperation isCancelled handling
  • Next by thread: Re: Proper NSOperation isCancelled handling
  • Index(es):
    • Date
    • Thread