When does the NSOperationQueue remove an operation from the queue?

jailani picture jailani · Feb 3, 2014 · Viewed 11.6k times · Source

I need to know that When does a NSOperationQueue remove an operation from the queue? I have NSOperationQueue which has list of NSOperation. At which point the NSOperationQueue removes an operation from queue?

  1. After starting an operation? OR
  2. After Finish/Cancel an operation?

Because I need a notification when all the operations in NSOPerationqueue are finished. For this I referred this link

Answer

Infinity picture Infinity · Feb 3, 2014

According to Apple Developer Reference

An operation queue executes its queued NSOperation objects based on their priority and readiness. After being added to an operation queue, an operation remains in its queue until it reports that it is finished with its task.

So, NSOperationQueue removes an operation after it has been finished.

Source - https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSOperationQueue_class/Reference/Reference.html