QuickTip: Notifications in Cocoa-touch
Posted in as3, cocoa touch, iphone, objective c on March 12th, 2009 by admin – 6 CommentsA very handy thing in cocoa is the use of notifications.
Although it doesn’t work exactly the same as Events in AS3, it can be used for the same principal.
There are 3 functions you need to keep in mind.
- (void)addObserver:(id)notificationObserver selector:(SEL)notificationSelector name:(NSString *)notificationName object:(id)notificationSender - (void)postNotificationName:(NSString *)notificationName object:(id)notificationSender userInfo:(NSDictionary *)userInfo - (void)removeObserver:(id)notificationObserver name:(NSString *)notificationName object:(id)notificationSender