Memory management in Objective-C is inspired by C/C++. It is mostly similar and also a little bit easier than C/C++. One has to release any object at the end of the program that has retain count of greater one so that there is no memory leak. Retain count is increased by a few operations such as alloc, retain and copy. There is also the concept of autorealese which is very similar to the local variables in C/C++.
Another important thing is one does not have to release primitive types like NSInteger which are stored in the stack and poped up at the end of the program execution.
No comments:
Post a Comment