mercredi 6 juillet 2016

NSOperation cancel and NSOperationQueue


i would like to understand what is the correct behavior for an nsoperation subclass. I have my subclasses with different isReady conditions. Yes, i check in the code if the operation is cancelled and i act in consequence. This is great while the operation is in execution. It stops its task, sets the finished to true and it gets deleted from the queue. but what about its dependencies? they are not yet executing, so they stay in the NSOperationQueue in cancelled state for ever.

Should i set ready = true for cancelled operations so the queue will call the start method that will set in executing and immediately finish the task setting finished to yes?

Thanks for the help.


Aucun commentaire:

Enregistrer un commentaire