Re: NSOperation and waitUntilFinished

2012-10-20 Thread Koen van der Drift
On Sat, Oct 20, 2012 at 2:55 PM, Jonathan Hull wrote: > You probably want to be using -addDependency: > > -waitUntilAllOperationsAreFinished just blocks the thread it is called on > until the receiver finishes (thus if you call it on the same thread as the > queue, it will block it forever). Th

Re: NSOperation and waitUntilFinished

2012-10-20 Thread Jonathan Hull
You probably want to be using -addDependency: -waitUntilAllOperationsAreFinished just blocks the thread it is called on until the receiver finishes (thus if you call it on the same thread as the queue, it will block it forever). If you need to do something after the operation is done which is n

Re: NSOperation and waitUntilFinished

2012-10-20 Thread Koen van der Drift
On Oct 20, 2012, at 1:15 PM, Koen van der Drift wrote: > > On Oct 20, 2012, at 12:53 PM, Gary L. Wade > wrote: > >> At the time when you call waitUntilAllOperationsAreFinished, no operations >> have been added, so there's nothing to wait on. Add the operation to the >> queue first and the

Re: NSOperation and waitUntilFinished

2012-10-20 Thread Koen van der Drift
On Oct 20, 2012, at 12:53 PM, Gary L. Wade wrote: > At the time when you call waitUntilAllOperationsAreFinished, no operations > have been added, so there's nothing to wait on. Add the operation to the > queue first and then call wait. > -- I tried that too, but then it just stays in the oper

Re: NSOperation and waitUntilFinished

2012-10-20 Thread Gary L. Wade
At the time when you call waitUntilAllOperationsAreFinished, no operations have been added, so there's nothing to wait on. Add the operation to the queue first and then call wait. -- Gary L. Wade (Sent from my iPhone) http://www.garywade.com/ ___ Coc

NSOperation and waitUntilFinished

2012-10-20 Thread Koen van der Drift
I am trying to understand how to wait for an NSOperation to complete, for example: NSOperationQueue *opQueue = [[NSOperationQueue alloc] init]; ImportOperation *importOp = [[ImportOperation alloc] initWithArray: anArray]; NSLog@"start import"); [opQueue waitUntilAllOperati