mbpro
mbpro

Reputation: 2490

NSOperation to all run consequently

I have program that is crashing somewhere not really visible to programmer. It may have something to do with memory management but it definitively has something to do with multiple threads and more than 200 notification observers...

I would like to know if that kind of starting derived NSOperation object would ensure that all operations are being executed consequently as normal execution on one thread?

[operation start];
[operation waitUntilFinished];

Upvotes: 0

Views: 1368

Answers (2)

Icydog
Icydog

Reputation: 467

I think what you're looking for is operationQueue.maxConcurrentOperationCount = 1 and then add all your operations to the NSOperationQueue. They will be executed serially, one after another.

Upvotes: 4

hypercrypt
hypercrypt

Reputation: 15376

No, it starts the operation and then blocks the calling thread until it is done.

Upvotes: 3

Related Questions