2

I have an NSOperationQueue and I want to cancel some operations. Therefore I iterate over the operation and cancel some tasks. At another point in the code which is executed subsequent in the same (UI) thread I check how many operations are in the queue. Even if I cancel all operations I get never 0. I guess the operations need to process the cancel properly. Therefore I would need some kind of "yield" function called in my UI thread after canceling. Is there a way to do that in Cocoa Touch?

My rather hackish solution is after cancel is:

[NSThread sleepForTimeInterval:0.1];

Any idea how to make that nicer?

Thanks, Lars

Lars Schneider
  • 5,530
  • 4
  • 33
  • 58

0 Answers0