Skip to content

Instantly share code, notes, and snippets.

@Galarius
Created November 17, 2014 08:18
Show Gist options
  • Save Galarius/9491b278d110cadfc545 to your computer and use it in GitHub Desktop.
Save Galarius/9491b278d110cadfc545 to your computer and use it in GitHub Desktop.
// wait until completion functions get called by method inside loop.
for(Object *o in objects)
{
__block BOOL block = YES;
[self applyMethod:o success:^(id result) {
//...
block = NO;
} failure:^(NSError *error) {
//...
block = NO;
}];
while (block)
{ [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment