If you create an object using Alloc, new, or a method that contains a copy function, you have ownership of the object. (if the retain count of the new object is 1 and is not in the auto-free pool, then you are obliged to release it when you are not using the object). Passing object ownership Some common methods are alloc (and often follow the Init method), copy and Mutablecopy.
Objects created by other means do not necessarily have ownership of the object. (The retain count for the new object is 1, which is placed in the auto-release pool, and if the object is retain before the auto-free pool is emptied, it will not be released, otherwise the object will be released).
Join does not own the ownership of an object, but want it to exist, can occur retain message to take ownership (this step increased the retain count)
Release and autorelease messages can occur when there is ownership of an object, but it is no longer needed. (the release message immediately reduces the retain count; the autorelease message only causes the release message to occur when the auto-free pool is emptied.) )
Only the object has an owner, and the object is not freed. (The DEALLOC message is sent when the retain count becomes 0 o'clock)
Retain count of memory management