Dark Horse programmer----Memory management of the second "multi-object memory Management"

Source: Internet
Author: User

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.