- 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.
推薦閱讀
- Vue.js 3.x快速入門
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- LaTeX Cookbook
- Hyper-V 2016 Best Practices
- SpringMVC+MyBatis快速開發(fā)與項目實戰(zhàn)
- Python高級機器學習
- INSTANT Passbook App Development for iOS How-to
- 從零開始學C#
- C++寶典
- Buildbox 2.x Game Development
- Kotlin進階實戰(zhàn)
- 實驗編程:PsychoPy從入門到精通
- Java從入門到精通(視頻實戰(zhàn)版)
- Visual Basic語言程序設計上機指導與練習(第3版)
- Mastering Object:Oriented Python(Second Edition)