注册通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showUpload:) name:@"CustomAlertViewShowOnKeyWindow" object:nil];
接收通知的方法
1. (void)showUpload:(NSNotification *)notification {
2. }
发送通知
[[NSNotificationCenter defaultCenter] postNotificationName:@"CustomAlertViewShowOnKeyWindow" object:nil userInfo:@{@"key":@"show"}];
- CustomAlertViewShowOnKeyWindow 是通知的名称
- 接收通知的方法必须加:(NSNotification *)notification