Last active
August 29, 2015 14:10
-
-
Save lukewar/448f6c71852b0374437b to your computer and use it in GitHub Desktop.
Blocking asynchronous operation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{ | |
dispatch_group_t dispatchGroup = dispatch_group_create(); | |
dispatch_group_enter(dispatchGroup); | |
[task runWithCompletion:^{ | |
dispatch_group_leave(dispatchGroup); | |
}]; | |
dispatch_group_wait(dispatchGroup, DISPATCH_TIME_FOREVER); | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment