Created
December 18, 2015 10:50
-
-
Save ygit/3fee286e3ff988efe807 to your computer and use it in GitHub Desktop.
Wait for an async block to complete with semaphores
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
dispatch_group_t group = dispatch_group_create(); | |
dispatch_group_enter(group); | |
[context performBlock:^{ | |
//block operations | |
dispatch_group_leave(group); | |
}]; | |
dispatch_group_wait(group, DISPATCH_TIME_FOREVER); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment