- 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.
推薦閱讀
- Google Flutter Mobile Development Quick Start Guide
- Flask Blueprints
- 數據結構和算法基礎(Java語言實現)
- 青少年美育趣味課堂:XMind思維導圖制作
- Django Design Patterns and Best Practices
- Learning Informatica PowerCenter 10.x(Second Edition)
- 算法精粹:經典計算機科學問題的Python實現
- NetBeans IDE 8 Cookbook
- ServiceNow:Building Powerful Workflows
- Orleans:構建高性能分布式Actor服務
- scikit-learn Cookbook(Second Edition)
- MySQL 8從零開始學(視頻教學版)
- Web前端開發最佳實踐
- 軟件測試技術
- C語言程序設計教程