比如:

    [[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

 

小细节,别忽略了哦

相关文章:

  • 2021-08-04
  • 2021-08-31
  • 2021-09-17
  • 2021-09-28
  • 2021-08-15
  • 2021-09-16
  • 2021-08-15
猜你喜欢
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
相关资源
相似解决方案