Memory Management--"multi-object memory management"1. Multi-Object Memory management method:
- As long as someone uses this object, the object cannot be destroyed ;
- As long as you want to use This object, let the object reference counter value +1( Let the object do a retain operation );
- When you no longer use this object, let the object's reference counter value -1( Let the object do a release operation );
- Who Alloc, who will release;
- Who retain, who will release;
2. Code specification for memory management:
- As long as the call to Alloc must have release/autorelease
- Code specification for the set method :
- 1. Basic data type : direct assignment;
- 2.OC Object Type :
- 3. Summary:
- Code specification for the Dealloc method :
- 1. Be sure to call [Super Dealloc]; And put it on the last side of the call!
- 2. Do a release operation on other objects owned by self (current object);
Dark Horse programmer----Memory management of the second "multi-object memory Management"