这些符号(-fno-objc-arc)是什么意思? [英] What do these symbols (-fno-objc-arc) mean?

查看:254
本文介绍了这些符号(-fno-objc-arc)是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中我混合了代码,都为ARC应用了编码样式,而有些则没有.然后,我遇到一个设置一些符号或标志的解决方案:-fno-objc-arc

I've got code mixed up in my Project both applying coding style for ARC and some are not. Then I come across a solution to set some symbols or Flags: -fno-objc-arc

我的问题是,这些标志是什么?这些符号是什么意思-fno-objc-arc?还有更多吗?

My question is, what are these Flags? and what do these symbols mean -fno-objc-arc? Are there more of these?

推荐答案

-fno-objc-arc标志用于编译器,而不用于链接器.它告诉编译器您的Objective C代码将手动执行所有释放和保留.这是必要的,因为新添加的ARC模式禁止显式使用releaseautoreleasedealloc;您甚至都无法通过选择器来调用它们.

The -fno-objc-arc flag is for the compiler, not for the linker. It tells the compiler that your Objective C code will be doing all the releasing and retaining manually. This is necessary because the newly added ARC mode prohibits explicit use of retain, release, autorelease, dealloc, and so on; you cannot call them even through a selector.

将所有代码转换为ARC可能是一项艰巨的任务,因此编译器同时支持新旧样式的代码.您必须告诉编译器您要编译的文件是旧文件还是旧文件;您可以通过传递-fno-objc-arc标志来实现.

Converting all your code to ARC may be a large task, so the compiler supports both the old and the new style of code. You must tell the compiler if the file you're compiling is old or new; you do it by passing the -fno-objc-arc flag.

还有许多其他编译器标志.它们使您可以控制代码的编译和优化方式,向您报告错误和警告的方式,标头所在的路径等.在终端窗口中键入man gcc以查看编译器选项的列表.

There are many other compiler flags. They let you control the way the code is compiled and optimized, the way the errors and warnings are reported back to you, the paths where your headers are located, and so on. Type man gcc in the terminal window to see the list of compiler options.

这篇关于这些符号(-fno-objc-arc)是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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