在创建的项目中禁止弧 [英] forbid arc in created project

查看:53
本文介绍了在创建的项目中禁止弧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用arc创建了一个项目.我使用了一些示例代码进行编译,它报告了很多ARC限制错误

I created an project with arc. I used some sample codes to compile, it reported a lot of ARC restrictions error

以后可以禁止电弧吗?

欢迎发表评论

推荐答案

在项目级别禁用Xcode的ARC:

 - Select your project file. 
 - You should be in the "Build settings" tab.Select the "levels" option (default is "Combined")
 - There’s a search      field to the right of "Combined".Enter "Automatic"
 - Second group    should be "Apple LLVM Compiler 3.0 – Language".
   Second line under    that controls ARC.
 - Click that line, then in the middle column (where    it says "yes"),
   click and choose "no".

为单个文件禁用ARC:

可以通过为单个文件添加 -fno-objc-arc 编译器标志来禁用单个文件的ARC.

It is possible to disable ARC for individual files by adding the -fno-objc-arc compiler flag for those files.

您可以在 Targets->中添加编译器标志.构建阶段->编译源代码.您必须双击编译器标志"下该行的右列.您还可以通过按住cmd按钮将其添加到多个文件中,以选择文件,然后按Enter键以显示标志编辑框.

You add compiler flags in Targets -> Build Phases -> Compile Sources. You have to double click on the right column of the row under Compiler Flags. You can also add it to multiple files by holding the cmd button to select the files and then pressing enter to bring up the flag edit box.

这篇关于在创建的项目中禁止弧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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