Lan Yi IOS Memory Management

Source: Internet
Author: User

This morning most of the time to review the contents of the study since the beginning of the school and explain yesterday's homework, yesterday's work in the realization of different Zomb scored different this function when the teacher skillfully use the value of self.speed to achieve different points, instead of assigning different tag last case The method of tag value to judge different zombies plus different scores is not usedif ([Z ISMEMBEROFCLASS:[ZOMBC class]]) method to judge different zombies plus different scores;

The afternoon was talked about memory management, the main contents are:

ARC: Automatic memory management

MRC: Manual Memory Management

Memory count Mechanism: Memory count indicates the number of times the current object is referenced, and if the number of references is 0, the object is freed from memory

Retain Memory Count +1

Release will count to memory-1

Effect of retain (strong) assign (weak) copy on the Set method:

Retain: Two things 1. Put the original release 2 new retain+1

Assign: Direct Assignment

Copy: Call copy and assign a value

The Dealloc method calls this method when the object memory count is 0 to release memory before releasing it in Arc to verify that the object has not been released

     < Span class= "Apple-converted-space" >     the second part of the content is the agreement:

A protocol is a method of an object to invoke a property and method of another object, the called object must satisfy a protocol declared by that object (Guize);

Lan Yi IOS 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.