123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #import "NSNotificationCenter+MainThread.h"
- @implementation NSNotificationCenter (MainThread)
- - (void)postNotificationOnMainThread:(NSNotification *)notification
- {
- [self performSelectorOnMainThread:@selector(postNotification:) withObject:notification waitUntilDone:YES];
- }
- - (void)postNotificationOnMainThreadName:(NSString *)aName object:(id)anObject
- {
- NSNotification *notification = [NSNotification notificationWithName:aName object:anObject];
- [self postNotificationOnMainThread:notification];
- }
- - (void)postNotificationOnMainThreadName:(NSString *)aName object:(id)anObject userInfo:(NSDictionary *)aUserInfo
- {
- NSNotification *notification = [NSNotification notificationWithName:aName object:anObject userInfo:aUserInfo];
- [self postNotificationOnMainThread:notification];
- }
- @end
|