Stack area: Contains the basic data type and object address, no need to consider the memory release problem
Heap area: Freed by programmer assignment. If the programmer does not release, the memory will never be released, causing a memory leak. In iOS, Alloc created objects are placed in the heap area.
The Alloc command causes a memory count of +1
Who's in charge?
The keywords inside the attribute brackets are used to control the contents of the set and get methods.
Retain (strong) will let the set method do two things 1. Release the original value 2. The value of the new pass in retain
Assign (weak) will allow only one thing in the set method to assign the value passed in to the global variable and memory count Independent
The base data type is assign by default with assign (weak)
Object type with retain (strong)
Lan Yi Education Memory management
Lan Yi Education Memory management