jeudi 9 février 2017

OperationQueue.cancelAllOperations does not call deinit method

Vote count: 0

In a for loop, I'm adding 10 operations in a queue. Also I'm setting maxConcurrentOperationCount = 3. In viewWillDisappear I'm calling cancelAllOperations. When, for ex. 3 operations are executed, they are removed from the queue, regarding setting the isFinished to true, but only the next 3 operations are cancelled, which is expected. After going back to the previous screen, deinit in this case is not called. If I cancelled them after 7-8 were executed, deinit would be called. Why is this happening? What about the rest of them that are not even started? If I comment maxConcurrentOperationCount = 3, deinit is called.

asked 21 secs ago

Let's block ads! (Why?)



OperationQueue.cancelAllOperations does not call deinit method

Aucun commentaire:

Enregistrer un commentaire