-2

我在我的应用程序中使用 AFNetworking。在我导入文件并构建应用程序后,我得到了 90 个错误,抱怨 ARC 模式。

ARC forbids explicit message send of 'autorelease'

我试图去编辑->折射->转换为Objective-C ARC

但后来我得到:

Cannot Convert to Objective-C ARC

Xcode found 93 issues that prevent conversion from proceeding.  Fix all ARC readiness issues and try again.

我不明白这个...

4

3 回答 3

4

不要尝试自己迁移AFNetworking到 ARC,要么更改为较新的版本(使用 ARC),要么对文件禁用 ARCAFNetworking。最好还是使用Cocoapod来管理你的依赖并忘记 ARC 不匹配的问题。

于 2013-11-14T22:25:25.137 回答
2

确保下载 AFNetworking 2.0。

于 2013-11-14T22:19:08.443 回答
1

在 Project Settings 的 Build Phases、Compile Sources 下,选择 AFNetworking 文件并添加 -fno-objc-arc 作为编译器标志。这会禁用这些文件的 arc。

不过我绝对同意。使用 Cocoapods 或使用 ARC 获取 AFNetworking 2.0 或 1.x

于 2013-11-14T22:32:59.920 回答