Here's what you want: > > __block BOOL exists; > dispatch_sync(dispatch_get_main_queue, ^{ > NSManagedObjectContext *context = … // grab the context > exists = … // query the context to see if the data already exists > });
Thanks Mike, that works very nice. Unfortunately, after all the importing, I now end up with an empty table in my UI, so with all the thread switches I must be forgetting something. (it worked fine when just using the main thread). So is there a way in Xcode to follow threads and (visually) get an idea about what happens on each one, so I can debug this? I have seen all the threads pop up in the left column during the execution, but I find that kinda difficult to follow. - Koen. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com