在 XCode 中使用旧的库和新的引用计数

发布于 2025-01-04 23:08:12 字数 138 浏览 2 评论 0原文

最新版本的 XCode 支持引用计数。然而,许多旧的库与新的引用计数架构不兼容。

是否有编译器选项或其他选项可以将非引用计数库与新的引用计数应用程序一起使用,或者我总是需要更新代码?

使用 C 的库(显然没有引用计数)会发生什么?

The latest version of XCode supports reference counting. However many older libraries are not compatible with the new Reference Counting architecture.

Is there a Compiler option or something to use non Reference Counted libraries with a new reference counted app, or do I always have to update the code?

What happens with libraries that use C (obviously not reference counted)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相权↑美人 2025-01-11 23:08:12

你可以这样做。在要更改的目标的构建阶段选项卡中,您可以在编译源部分下为项目中的每个文件设置编译器标志。

只需为您不想使用 ARC 的文件设置编译器标志即可:

fno-objc-arc

disable ARC example

您可以在选择文件时按住 Cmd 一次将标志添加到多个文件。

You can do this. In the build phases tab for the target you want to change, you can set compiler flags for each file in your project under the Compile Sources section.

Simply set the compiler flags for the files you don't want to use ARC on to:

fno-objc-arc

disable ARC example

You can hold Cmd while selecting files to add the flag to several files at once.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文