Re: NSOperation and waitUntilFinished
Re: NSOperation and waitUntilFinished
- Subject: Re: NSOperation and waitUntilFinished
- From: Koen van der Drift <email@hidden>
- Date: Sat, 20 Oct 2012 13:32:08 -0400
On Oct 20, 2012, at 1:15 PM, Koen van der Drift <email@hidden> wrote:
>
> On Oct 20, 2012, at 12:53 PM, Gary L. Wade <email@hidden> 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.
So it hans, because inside my import code is the following:
dispatch_sync(dispatch_get_main_queue(), ^{
AppDelegate *appController = [[NSApplication sharedApplication] delegate];
NSManagedObjectContext *mainContext = [appController managedObjectContext];
NSLog(@"test");
which was suggested in another question I had to be able to call executeFetchRequest on the mainContext from another thread.
Maybe that doesn't work well with calling waitUntilFinished?
- Koen.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden