Company - Blog

June 23, 2010

Your Contract With Objective-C

Filed under: Software Development — Tags: , — Travis Boudreaux @ 6:56 am

Here’s a simple “contract” that I learned at iPhone Bootcamp from Nathan Eror.

If you get an object from alloc, copy or new, you must autorelease or release it when you’re done.

• If you retain something, you must autorelease or release it when you’re done.

• If you get an object from anywhere else, DO NOT release or autorelease it.