JsonKit|JsonKit Objective-C's isa is deprecated错误
项目中用到了JsonKit解析器,但是每次运行都会报一堆错误。
Assignment to Objective-C's isa is deprecated in favor of object_setClass()
Direct access to Objective-C's isa is deprecated in favor of object_getClass()
这时,我们需要将Build Settings中的CLANG_WARN_DIRECT_OBJC_ISA_USAGE设置为NO。手动修改它实在不是明智之举,因为你修改了Podfile,重新执行$ pod install后,JSONKit target的设置又被还原了。解决方案如下:
【JsonKit|JsonKit Objective-C's isa is deprecated错误】在Podfile最后,添加一个post_install hook,由它来帮我们修改
CLANG_WARN_DIRECT_OBJC_ISA_USAGE
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
if target.name == 'JSONKit'
target.build_configurations.each do |config|
config.build_settings['CLANG_WARN_DIRECT_OBJC_ISA_USAGE'] = 'NO'
end
end
end
end
推荐阅读
- EffectiveObjective-C2.0|EffectiveObjective-C2.0 笔记 - 第二部分
- C语言字符函数中的isalnum()和iscntrl()你都知道吗
- Objective-c
- DANISA皇冠——谁说夏天不适合吃曲奇
- 在Objective-C的Category中使用属性的懒加载
- 复仇者联盟4动态壁纸和屏保,动态锁屏,iWall和iSaver
- Sha—Lisa
- Objective-C回调
- 浅析Objective-C之block
- Objective-C命名规范