Created
April 21, 2013 03:20
-
-
Save aranm/5428332 to your computer and use it in GitHub Desktop.
Make sure that you respond to notifications on the main thread
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)respondToNotification:(NSNotification *)notification { | |
if (![NSThread isMainThread]) { | |
[self performSelectorOnMainThread:@selector(respondToNotification:) withObject:notification waitUntilDone:YES]; | |
return; | |
} | |
//Code here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment