GCD 通知
2020-04-10 本文已影响0人
Fade1992
/** 通知 */
@property (nonatomic,weak)id notice;
// WS(weakSelf);
_notice = [[NSNotificationCenter defaultCenter] addObserverForName:NOTIFICATION_DEL_COMPETITION_DATA_BJDC object:nil queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) {
NSLog(@"通知方法调用");
}];
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}