Objective-C memory management rules

25 May 2010

  1. You own any object you create
  2. You can take ownership of an object using retain
  3. You must relinquish ownership of objects you own when you’re finished with them
  4. You must not relinquish ownership of an object you do not own

— Apple’s Memory Management Programming Guide for Cocoa