比如:
[[NSNotificationCenter defaultCenter] postNotificationName:@"Notification_Name" object:nil userInfo:@{@"paramName":@YES}];
再接收通知获取参数处理时:
-(void)Handle:(NSNotification *)notification{
BOOL isFirst = notification.userInfo[@"isFirstLocation"];
NSLog(@"isFirst:%d",isFirst);
//这里不能直接写 if (isFirst),必须如下写法
if (isFirst == 1) {
//表示Yes
}
}
if判断里,必须写 == 1/0,来判断yes/no
小细节,别忽略了哦