Learning Objective-C 2.0: A Hands-on Guide to Objective-C for Mac and iOS Developers, Second Edition
by Robert Clair
16. ARC
Memory management is the bane of programming in Objective-C. Beginners find it confusing and difficult to learn. Even experienced Objective-C programmers seem to have trouble following the rules from time to time. The result is often memory leaks, crashes, and hours spent chasing memory bugs. Over the past years Apple has made several attempts to make the task of memory management less onerous.
The first attempt was garbage collection (GC). In a program that uses garbage collection a separate thread wakes up periodically, examines the program’s memory, and returns objects that are not being used to the heap. Unfortunately, GC impacts performance and has other issues. GC was never available on iOS, and it is deprecated in OS X beginning ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access