Skip to content

Instantly share code, notes, and snippets.

@lemonkey
Forked from quellish/waitForBlock.m
Created October 28, 2016 01:14
Show Gist options
  • Save lemonkey/68bf8c3fadbb84663c47892f56f1a5a2 to your computer and use it in GitHub Desktop.
Save lemonkey/68bf8c3fadbb84663c47892f56f1a5a2 to your computer and use it in GitHub Desktop.

Revisions

  1. @quellish quellish created this gist Aug 9, 2014.
    7 changes: 7 additions & 0 deletions waitForBlock.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    group = dispatch_group_create();
    dispatch_group_enter(group);
    [context performBlock:^{
    result = [context executeFetch:...
    dispatch_group_leave(group);
    }];
    groupResult = dispatch_group_wait(group, DISPATCH_TIME_FOREVER);