• 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
NSOperation cancellation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSOperation cancellation


  • Subject: NSOperation cancellation
  • From: Thomas Engelmeier <email@hidden>
  • Date: Mon, 25 May 2009 19:15:44 +0200

Hi,

I'm running into some trouble with NSOperation / NSOperationQueue.

In order to tear down everything gracefully, I use something like

	[queue cancelAllOperations];
	[queue waitUntilAllOperationsAreFinished];

My NSOperation subclasses just have a straightforward -(void) main method.

It works as advertised for me unless I'm trying to cancel the operations.

Regular run:
 (MyOperation) change of isExecuting to 1
 (MyOperation) change of isExecuting to 0
 (MyOperation) change of isFinished to 1

Cancel run:
 (MyOperation) change of isExecuting to 1
** Cancel...
(MyOperation) change of isCancelled to 1

My op polls isCancelled, returns from main and nothing more happens. op.isFinished and op.isExecuting is not updated, bringing waitUntilAllOperationsAreFinished and other KVC observers to an halt. Do I really need to reimplement the whole state (isFinished, isExecuting) logic just in order to support cancellation?

TIA,
	Tom_E


_______________________________________________

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: NSOperation cancellation
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Data storage/retrieval
  • Next by Date: NSTreeController and CoreData question
  • Previous by thread: Re: Data storage/retrieval
  • Next by thread: Re: NSOperation cancellation
  • Index(es):
    • Date
    • Thread