Automatic Reference Counting (ARC) not enforced
Automatic Reference Counting (ARC) not enforced
Description
Automatic Reference Counting (ARC) is memory management that automates object management by the compiler to unburden the developer.
Recommendation
To enable ARC for the entire project:
- Open Xcode project.
- Go to project settings.
- Select target.
- Navigate to "Build Settings" tab.
- Search for "Objective-C Automatic Reference Counting".
- Set "Objective-C Automatic Reference Counting" to "YES".
Alternatively, enable ARC for specific files:
- Locate file(s) where ARC should be enabled.
- Select file(s) in project navigator.
- Go to "File Inspector" on the right.
- Find "Compiler Flags" section.
- Add
-fobjc-arc
to compiler flags. - Save changes.
Links
- Automatic Reference Counting (Wikipedia)
- Automatic Reference Counting (LLVM)
- Automatic Reference Counting for Swift (Apple developer)
Standards
- OWASP_MASVS_L1:
- MSTG_CODE_9
- OWASP_MASVS_L2:
- MSTG_CODE_9
- PCI_STANDARDS:
- REQ_2_2
- REQ_6_2
- OWASP_MASVS_v2_1:
- MASVS_RESILIENCE_4