Managing object memory is a matter of performance; if an application doesn’t free unneeded objects, its memory footprint grows and performance suffers and sometimes your application crash. THAT'S BAD:( Memory management in a Cocoa application that doesn’t use garbage collection is based on a reference counting model. OK lets see a sample
image from oficial cocoa doc
I'll try help you to explicitly manage memory in Objective-C code with simple tips
  • If you are not the creator of an object, but want to ensure it stays in memory for you to use, you can express an ownership interest in it.
  • Related method: retain
  • If you own an object, either by creating it or expressing an ownership interest, you are responsible for releasing it when you no longer need it.
  • Related methods: release, autorelease
  • Conversely, if you are not the creator of an object and have not expressed an ownership interest, you must not release it.
If you receive an object from elsewhere in your program and you want it to remain valid beyond that scope, you should retain or copy it. If you try to release an object that has already been deallocated, your program crashes. Remember in OS X you have a garbage collection feature of Objective-C, but in iOS this feature is not avaliable.