Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 是否在ARC应用程序中包含非ARC库?_Ios_Automatic Ref Counting - Fatal编程技术网

Ios 是否在ARC应用程序中包含非ARC库?

Ios 是否在ARC应用程序中包含非ARC库?,ios,automatic-ref-counting,Ios,Automatic Ref Counting,那么,有可能吗 我多次遇到此错误: ARC forbids Objective-C objects in structs or unions 例如: typedef struct { BOOL _field1; union { struct { id _field1; id _field2; } _field1; GSEventRef _field2; } _field2;

那么,有可能吗

我多次遇到此错误:

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;

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

但我只有标题,没有框架工作的来源,我明白你的意思了。我认为在这种情况下,您将无法在与此库接口的代码中使用ARC,因为结构定义中不能有对象(
id\u字段1
id\u字段2
)。不过我会去打猎的,因为我以前没见过这么多。我只是将需要框架的代码包装在一个非ARC类中,并将
-fno objc ARC
标志设置为编译器。然后我从ARC代码内部调用了类方法。看起来很好用!是的,老实说,那将是我想要的解决办法。很高兴你解决了这个问题。@mattjgalloway那么你的意思是你复制粘贴了需要单独的类,而不是在.framework中,对吗?然后加上国旗?