Created
May 4, 2018 06:56
-
-
Save zhangkn/37a271df3bbd39860f9476ab92843707 to your computer and use it in GitHub Desktop.
线程间通信示例
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_async( | |
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
// 执行耗时的异步操作... | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
// 回到主线程,执行UI刷新操作 | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment