Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.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/8/swift/18.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 编译器标志-fno objc arc在Swift中不工作_Ios_Swift_Automatic Ref Counting - Fatal编程技术网

Ios 编译器标志-fno objc arc在Swift中不工作

Ios 编译器标志-fno objc arc在Swift中不工作,ios,swift,automatic-ref-counting,Ios,Swift,Automatic Ref Counting,我的程序是用Swift编写的,类依赖于“无泄漏SKShapeNode”。这个类是用Obj-C编写的,因此需要使用编译器标志。我在SKShapeNodeLeakFree.m文件上实现了-fno-objc-arc,但是编译器仍然没有检测到arc被禁用 目标的“构建阶段”的“编译源代码”中的-fno objc arc设置看起来不错 看起来您一定是错误地导入了桥接头中的.m文件。您应该在桥接头中导入.h文件。这就解释了为什么您会在“Swift编译器错误”部分下看到Objective-C ARC消息。@

我的程序是用Swift编写的,类依赖于“无泄漏SKShapeNode”。这个类是用Obj-C编写的,因此需要使用编译器标志。我在SKShapeNodeLeakFree.m文件上实现了-fno-objc-arc,但是编译器仍然没有检测到arc被禁用


目标的“构建阶段”的“编译源代码”中的
-fno objc arc
设置看起来不错


看起来您一定是错误地导入了桥接头中的
.m
文件。您应该在桥接头中导入
.h
文件。这就解释了为什么您会在“Swift编译器错误”部分下看到Objective-C ARC消息。

@Rob我会试试,但在我这么做之前,您是否认为这可能是由于未能导入桥接头的最后一个错误造成的?更准确地说,我怀疑是“导入失败”错误是同一事物的另一个症状,它会向您发送其他错误消息。看起来您在桥接头中导入了
.m
文件,而不是
.h
文件。这就是问题所在。实际上,我将.m和.h文件都导入了头文件。