NSNotification _ 通知
注意:做核心处理的一般而言都被设置为单例方法。
NSNotifcationCenter是一个单例方法。
SEL 是代表“方法”的数据类型。
1、自定义通知的实现
(1)创建通知
NSNotification * not = [NSNotification notificationWithName:@" message"Object:(self) userInfo:nil];
(2)注册通知:获取通知中心对象
[NSNotificationCenter defaultCenter] addObserver: (监听者,一般是self)selector:(调用的方法:)name:(通知名)object:(一般为nil)];
(3)发送通知
[[NSNotificationCenter defaultCenter] postNotification:not object:self userInfo:dic];
];