简体   繁体   English

LLVM 5.1编译错误“已弃用isa”

[英]Compiler Error with LLVM 5.1 “Deprecated isa”

I am getting compiler errors with libJSONKit and in JSONKit.m . 我在libJSONKitJSONKit.m遇到编译器错误。 The errors are thrown with this: "Assignment to Objective-C's isa is deprecated in favor of object_setClass()" . 抛出的错误是: "Assignment to Objective-C's isa is deprecated in favor of object_setClass()"
There is also a secondary error: "Direct access to Objective-C's isa is deprecated in favor of object_getClass()". 还有一个次要错误: "Direct access to Objective-C's isa is deprecated in favor of object_getClass()".

Any advice on workarounds or solutions? 有关变通方法或解决方案的任何建议吗?

Simply follow the advice in the error message: 只需按照错误消息中的建议操作:

Change: 更改:

object->isa  = SomeClass;

to: 至:

object_setClass(object, SomeClass);

You might have to remove the 64 bit architecture from your project settings. 您可能必须从项目设置中删除64位体系结构。

This is happening because Apple added arm64 as part of the standard architectures updating to iOS 7.1 and Xcode 5.1. 发生这种情况是因为Apple将arm64添加为更新到iOS 7.1和Xcode 5.1的标准体系结构的一部分。 You might have to manually set it to armv7, armv7s... JSONKit does not support arm64 yet. 您可能必须手动将其设置为armv7,armv7s ... JSONKit尚不支持arm64。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM