Created
October 18, 2012 12:03
-
-
Save jiro/3911379 to your computer and use it in GitHub Desktop.
KVOの受信処理がメインスレッドで処理されるのを保証する ref: http://qiita.com/items/f7b10aac3ed515798d22
This file contains hidden or 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
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context | |
{ | |
if (![NSThread isMainThread]) { | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
[self observeValueForKeyPath:keyPath ofObject:object change:change context:context]; | |
}); | |
return; | |
} | |
// KVOに関する処理 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment