←Older revision | Newer revision→
Reference counting is used to automatically deallocate objects when they are no longer needed.
Using reference counting
By convention when using an autorelased object you must "retain" before using it, and release it when you are done with it. For consistency you may "retain the object you want at the beginign of your method, and release it at the end, though in a tight loop you may wish to only retain once.
[myObject retain] //my code [myObject release]
[myObject retain] for(int64_t i = 0; i<LONG_LONG_MAX; i++)
//Remove retain/relase overhead