iOS关于通知传值Bool类型的注意点
2016-12-29 16:06
288 查看
比如:
再接收通知获取参数处理时:
if判断里,必须写 == 1/0,来判断yes/no
小细节,别忽略了哦
[[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
小细节,别忽略了哦
相关文章推荐
- 关于iOS中使用通知进行传值
- 关于Linux下C语言编译器gcc不认识bool类型的问题
- 关于UrlReferrer传值的几点注意
- IOS中多版本,多设备类型支持注意事项
- Cocos2d-x 关于在iOS平台真机测试的一些注意
- Cocos2d-x 关于在iOS平台真机测试的一些注意
- 关于数据类型Char要注意的地方
- ios开发nil检查、BOOL类型陷阱
- ios SDK开发之关于CoreAnimation的一些注意点总结
- 个人关于iOS推送通知优化的概念
- IOS中多版本,多设备类型支持注意事项
- 关于UrlReferrer传值的几点注意
- 关于String类要注意的地方和java中基本类型的转化
- 关于取反、移位、类型转换需要注意的一些问题
- ios 关于如何在两个页面间传值
- 关于rdlc类型的报表发布的时候注意事项
- 关于Linux下C语言编译器gcc不认识bool类型的问题(转)
- java中基本类型的转化和关于String类要注意的地方
- 注意 方法的执行 顺序,并且 如果 为 nil的话,bool类型的数据 也默认是有值的,
- ios开发——输出BOOL类型的值