Bit masking for introspection of Objective-C object pointer is strongly discounraged
2016-05-11 14:34
579 查看
在使用到JSONKit框架的时候警告:Bit masking for introspection of Objective-C object pointer is strongly discouraged,虽然不影响使用,但还是希望没有警告。
网上找到两种解决方案
方案一:
方案二:("某数字" & 0x1 的时候, 代表取最低位,用%2 替换 &0x1 )
用 JK_EXPECT_F(((NSUInteger)object)%2) 替换 JK_EXPECT_F(((NSUInteger)object) &0x1)
资料来源于:http://blog.sina.com.cn/s/blog_8aecea5f0102uxec.html
网上找到两种解决方案
方案一:
<span style="font-size:18px;"> #pragma clang diagnostic push #pragma clang diagnostic ignored"-Wdeprecated-objc-pointer-introspection" BOOL workAroundMacOSXABIBreakingBug = (JK_EXPECT_F(((NSUInteger)object) &0x1)) ? YES : NO; #pragma clang diagnostic pop</span>代替
<span style="font-size:18px;"> BOOL workAroundMacOSXABIBreakingBug = (JK_EXPECT_F(((NSUInteger)object) &0x1)) ? YES : NO;</span>
方案二:("某数字" & 0x1 的时候, 代表取最低位,用%2 替换 &0x1 )
用 JK_EXPECT_F(((NSUInteger)object)%2) 替换 JK_EXPECT_F(((NSUInteger)object) &0x1)
资料来源于:http://blog.sina.com.cn/s/blog_8aecea5f0102uxec.html
相关文章推荐
- object-c中Foundation框架-日期和时间-----------包含定时器
- [论文阅读]HyperNet: Towards Accurate Region Proposal Generation and Joint Object Detection
- relocation R_X86_64_32 against XXXXX can not be used when making a shared object;recompile with -fPI
- object-c中Foundation框架-NSString与NSMutableString
- iOS基础:深入理解Objective-c中@class的含义
- iOS基础:深入理解Objective-c中@class的含义
- object-c中的@try
- object-c-协议-protocol
- Objective-C的Block
- 浅析C# 中object sender与EventArgs e (转)
- 文献笔记 You Only Look Once:Unified, Real-Time Object Detection
- 理解 Objective-C Runtime
- Objective-C与Runtime的那点事儿消息机制
- object-c中扩展--extension
- Objective-C与Runtime的那点事儿消息机制
- 理解 Objective-C Runtime
- 数组、字典(16.5.11)
- 读书总结之NSObject
- JavaScript之Object
- Swift和Objective-C的不同