The semi-automated memory management mechanism provided by the object-C does simplify maintenance.
The memory management mechanism implemented by Object-C is counter-based, similar to the object maintenance mechanism of COM. This management mechanism is highly efficient. Compared with Java and. Net's automated three-level memory management mechanism, automation is somewhat inferior, but performance and resource utilization are indeed incomparable. I personally think that it is a good option to automatically manage the memory version by referencing the counter in applications of different magnitude.
This is the background. There is a pool management region between the NSAID object and the release object. When the release object is released, the pool will automatically clear the memory declared on the stack in this region. Note that the system will automatically clean up the memory that is considered useless in this region without your own release. Generally, the basic type is initialized on the stack. We do not consider it. Because the object type is more of an operation unit, there is not much cross-scope reference, generally, there won't be too many problems. The problem is returned to the string type. The character types supported by Object-C include char, char [], char *, String, nsstring, nsmutablestring, Char, char [] is initialized on the stack without consideration. Other forms are encapsulation of char and initialized on the stack. Generally, the replication of pointer objects is considered to be shortest in terms of efficiency. It only pays an address pointer and does not actually copy data in the region. This creates a problem. The data will be cleared when the system deems that the original object is useless, and the new object is still pointing to the original location, now, operations on this object will have very serious consequences. Although we can use the retain mechanism to add 1 to the object reference counter, we cannot know exactly whether the system will automatically clean up when releasing, and it seems that the system will usually clean up at this time. It is dangerous to operate global string objects in this region.