Saturday, April 27, 2013

NSNotificationCenter postNotification example ios


postNotification:

Posts a given notification to the receiver.
- (void)postNotification:(NSNotification *)notification
Parameters
notification
The notification to post. This value must not be nil.
Discussion of [NSNotificationCenter postNotification]
You can create a notification with the NSNotification class method notificationWithName:object: ornotificationWithName:object:userInfo:. An exception is raised if notification is nil.
Example of [NSNotificationCenter postNotification]

[[NSNotificationCenter defaultCenter] postNotificationName:@"HotSpotTouched" object:self userInfo:itemDetails ];


- (void)hotSpotMore:(NSNotification *)notification {
      NSLog(@"%@", notification.userInfo);
      NSLog(@"%@", [notification.userInfo objectForKey:@"HelpTopic"]);    
}