在ARC应用程序中包含非ARC库? [英] Include non-ARC library in an ARC app?

查看:113
本文介绍了在ARC应用程序中包含非ARC库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那么,有可能吗?

我多次出现此错误:

ARC forbids Objective-C objects in structs or unions

例如这里:

typedef struct {
    BOOL _field1;
    union {
        struct {
            id _field1;
            id _field2;
        } _field1;
        GSEventRef _field2;
    } _field2;
} XXStruct_CKAdxD;


推荐答案

您需要添加 - fno-objc-arc 到每个不能/不能使用ARC的文件的编译器选项。在Xcode中,您可以从目标的编译源构建阶段执行此操作。双击该文件并将 -fno-objc-arc 添加到弹出的框中。

You need to add -fno-objc-arc to the compiler options for each file that doesn't / can't use ARC. Within Xcode you do this from the 'Compile Sources' build phase of your target. Double click the file and add -fno-objc-arc to the box that pops up.

这篇关于在ARC应用程序中包含非ARC库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆