如何收听广播
1
在广播中心注册
[NSNotificationCenter defaultCenter]
- (void)addObserver:(id)observer
selector:(SEl)methodToInvokeIfSomethingHappens
name:(NSString *)name
object:(id)sender;
-(void)methodtoinvokeifsomethinghappens:(nsnotification *)notofication
{
notification.name
notification.object
notification.userinfo
}
2 关闭广播
[center removeObserver:self];
or
[center removeObserver:self name:UIContentSizeCategoryDidChangeNotification object :nil];