[Reading Notes] iOS-garbage collection, ios-garbage collection

Source: Internet
Author: User

[Reading Notes] iOS-garbage collection, ios-garbage collection

Objective-C is an inherited garbage collector. Compared with objects that have existed for a period of time, newly created objects are more likely to be treated as garbage. The garbage collector regularly checks variables and objects and pointers between them. When no variable points to an object, the object is considered as the garbage to be discarded. The worst thing is to keep a pointer to an object that is no longer in use. Therefore, if you point to an object in an instance variable, you must set the instance variable value to nil at a certain time, to cancel the reference to this object and make the Garbage Collector know that this object can be cleared.

 

References: Objective-C basic tutorial

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.