Clicky

iOS Dev Nugget 11 Use Automatic Reference Counting (ARC)

.

Need to run a code review on your codebase? Hire me

There's no good reason to start a project that doesn't use Automatic Reference Counting. Your code ends up being shorter and less prone to leaks and crashes. If you have libraries or older code that doesn't use ARC, add the compilation flag -fno-objc-arc for that implementation file. In Xcode, you can do this by going to the build target and choosing Build Phases > Compile Sources, paste in -fno-objc-arc to Compiler Flags. Tip: you can select multiple files and double click them to modify compiler flags for all of them.


Your feedback is valuable: Do you want more nuggets like this?   Yes   or   No

.

Like this and want such iOS dev nuggets to be emailed to you, weekly?

Sign Me Up! or follow @iosdevnuggets on Twitter

.

View archives of past issues