gpt4 book ai didi

ios - 如何制作特定的类文件 ARC - iphone

转载 作者:可可西里 更新时间:2023-11-01 05:41:49 32 4
gpt4 key购买 nike

我正在尝试将 XMPP 框架中的附加 ampp 类文件 XMPPPubSub 类集成到我的应用程序中。它说我们必须为这些文件启用 ARC。

我在 Build Phases-> Compile Sources 中为文件添加了 -fobjc-arc 标志。该类中有这段代码

#if ! __has_feature(objc_arc)
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif

即使这样我还是会报错

cc1obj: error: unrecognized command line option "-fobjc-arc"

我已经看过这些链接了

1) How to require ARC in a class?

2) How to add ARC for specific file?

3) How to enable ARC for a single file

但还没有运气。我在这里错过了什么吗?

请给点建议

最佳答案

可能您的项目设置为使用错误的编译器。在您的项目设置中,检查您使用的是 Apple LLVM Compiler 而不是 LLVM GCC。

从演示项目中查看此图像以了解在何处查找:

enter image description here

关于ios - 如何制作特定的类文件 ARC - iphone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13928886/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com