I want to know if my Xcode iPhone project is using ARC, and I can’t remember if I ticked that box when creating the project.
How can I get this information?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Select your project, then Build Settings. Look for Objective-C Automatic Reference Counting in the Apple LLVM Compiler – Language section. Make sure you select the target; while you can set this in the project, the target can override it.
(You can also use the search bar in Build Settings for
OBJC_ARC.)Keep in mind, too, that you can turn ARC on or off on a per file basis in build phases.
Or, just try something like this in code:
If you get an error:
Then you’re using ARC.
You can also require ARC from a source code file by checking for it: