ios5 ARC 什么是从 ARC 中排除文件的编译器标志? [英] ios5 ARC what is the compiler flag to exclude a file from ARC?

查看:19
本文介绍了ios5 ARC 什么是从 ARC 中排除文件的编译器标志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能帮我记住告诉 XCode 对某些文件不使用 ARC 的标志是什么?我的项目中有几个文件被标记为这样...直到我添加了另一个文件并决定将其转换为 ARC.听起来很容易,对吧?我希望我能够简单地检查我想要的文件并让 XCode 发挥它的魔力.好吧,不是那么容易,在预检查期间它从文件中删除了所有 -Noarc 标志,现在我需要手动将标志重新应用于多个文件.

Can anyone help me remember what was the flag to tell the XCode to not use ARC for some file? I had several files in my project marked as such... Until I added another file and decided to convert that one to ARC. Sounds easy, right? I expected that I would be able to simply check a file that I want and let the XCode do it's magic. Well, not so easy, during pre-check it stripped all -Noarc flags from the files and now I need to manually re- apply the flag to several files.

这个故事的寓意是:一旦您的项目在 ARC 中并且您有一些文件标记为无 ARC,请不要从 Refactor>Convert to ARC 重新运行转换为 ARC 工具.即使预检查失败,它也不会恢复您的设置.

the moral of this story is: once your project is in ARC and you have some files marked as no ARC, do not re-run the convert to ARC tool from Refactor>Convert to ARC. It will not restore your settings even if pre-check fails.

推荐答案

我找到了答案:要从 ARC 中排除文件,请在构建阶段使用 -fno-objc-arc 标志>compile来源

I found the answer: to exclude the file from ARC, use the -fno-objc-arc flag in build phases>compile sources

这篇关于ios5 ARC 什么是从 ARC 中排除文件的编译器标志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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