- Objective-C Memory Management Essentials
- Gibson Tang Maxim Vasilkov
- 197字
- 2021-07-23 20:09:13
Project settings for ARC
When a project is set to utilize ARC, the compiler flag -fobjc-arc
is by default set for every Objective-C source file. ARC can be disabled for particular classes through the compiler flag, -fno-obj-arc
. In Xcode, go to the target Build Phases tab, open the Compile Sources group, and you will be able to see the source file list. When you double-click on the file where you want to set it, a pop-up panel will appear. In that panel, get in the -fno-obj-arc
flag and click on Done to finish.
If ARC was not enabled when the project was created, then to enable it, follow this process:
- Open the project.
- Go to Edit | Refactor | Convert to Objective-C ARC.
- If there is no problem and it's ready to convert, it will check your code.
By default, all newly created Objective-C projects in Xcode 5 are enabled with ARC. However, if you need to disable it, follow these steps:
- Select Project.
- Select Targets.
- From the right panel, go to Build Settings.
- Select Automatic Reference Counting.
- Select Apple LLVM compiler 3.0 – Language.
- Locate Objective-C++ Automatic Reference Counting and, in all three sections, select NO.
推薦閱讀
- 深入理解Django:框架內(nèi)幕與實(shí)現(xiàn)原理
- 實(shí)戰(zhàn)Java程序設(shè)計(jì)
- Practical DevOps
- Yocto for Raspberry Pi
- PySide 6/PyQt 6快速開(kāi)發(fā)與實(shí)戰(zhàn)
- Android開(kāi)發(fā)三劍客:UML、模式與測(cè)試
- 搞定J2EE:Struts+Spring+Hibernate整合詳解與典型案例
- Java編程從入門(mén)到精通
- Deep Learning with R Cookbook
- RocketMQ實(shí)戰(zhàn)與原理解析
- C++程序設(shè)計(jì)教程(第2版)
- Arduino Wearable Projects
- 嵌入式Linux C語(yǔ)言程序設(shè)計(jì)基礎(chǔ)教程
- 軟件工程與UML案例解析(第三版)
- Xamarin Cross-Platform Development Cookbook