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 not an 
operation itself, then you probably want to look at -setCompletionBlock:.  The 
block you provide will get called once the operation is complete (and let you 
clean things up, etc…).  Note that the block may not be called on the main 
thread.

Thanks,
Jon

On Oct 20, 2012, at 10:15 AM, Koen van der Drift <[email protected]> 
wrote:

> 
> On Oct 20, 2012, at 12:53 PM, Gary L. Wade <[email protected]> 
> 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 operation and never finishes:
> 
> start import
> begin of importRecords in operation
> 
> and nothing else, it just sits there.
> 
> - Koen.
> _______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/jhull%40gbis.com
> 
> This email sent to [email protected]
> 


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to