How to Use nsicationicationcenter in the notification center
NSNotificationCenter(Notification center)
Note]The observer needs to be removed from dealloc. Obtain the notification center singleton object
Nsicationicationcenter * center = [NSNotificationCenter defacenter center];
Common Methods: 1. register the observer-(void) addObserver :( id) observer selector :( SEL) aSelector name :( NSString *) aName object :( id) anObject; parameter: observer aSelector: this method is automatically called when a notification is received. aName: the message content (the "digit" of the notification to be received) anObject: generally nil 2. send notification message-(void) postNotificationName :( NSString *) aName object :( id) anObject userInfo :( NSDictionary *) aUserInfo; parameter: aName: who registered the notification center, when this message content is set in observer mode, anObject is notified: The Transmitted parameter (any object) aUserInfo: The transmitted dictionary.
NSNotification(If a parameter is included in the method called by the notification, this object is passed.) Common Methods: 1. Obtain the passed parameter-(id) object; 2. Obtain the passed dictionary.
-(NSDictionary *) userInfo;