August 19, 2015 09:54:45

Source: Internet
Author: User

Object pointer: 1, the object pointer completes the specific function by manipulating the memory it points to

-When the object pointer points to nil, this object is called an empty object

-nil is the default value for the object pointer

-null object without any function or effect

2, gets the memory address that the object pointer points to

-Get through alloc or convenience builder

-Get through the method

* Local Object pointer

-Scope is bounded by curly braces

-{

ID obj;

}

* Global Object pointers

-member variables that are declared manually

-member variables for attribute declarations

* Local Object pointer

-Normal use (default)

-Temporary variables

* Global Object pointers

-Recommended use of all properties

-One object is part of another object

-common data that the entire object needs to use

-External Data Interface for objects

* Strong reference (default)

-pointer to an object with __strong or no identity

-Memory is not freed when used by this type of object pointer

* Return to zero weak references

-pointer to an object identified by __weak

-When memory is used by this type of object pointer, it may be released at any time

-the object pointer using this memory is set to nil after the memory is released

* Weak references

-pointer to an object identified by __unsafe__unretain

-Memory is released at any time and the object pointer is not set to nil

* Automatic release of the pool (can adjust the automatic release time)

[Email protected] {

Ikeuchi

}

is essentially a piece of code area, bounded by curly braces

* Auto-Release type Object

-pointer to an object identified by __autoreleasing

-The memory that is used or used by the object pointer is freed from the auto-free pool, regardless of whether the object pointer exists.

-by cooperating with the auto-release pool and delaying or releasing memory early

* Memory Management Specification

* General Conditions

-Except for special circumstances, it is the general situation

-Use strong type

* Special Type

-Cross Reference//strong reference loops

-reference chain closed loop//strong reference loop

-Returns the amount of memory address created by method

-Create a large number of objects within a loop through methods

———————— when the object is released, go to the Dealloc method

Convenience Builder

+ (Instancetype) student

{

__autoreleasing Student *s = [[Student alloc]init];

return s;

If you return a piece of memory through a method, the memory must be an object that has been used by autoreleasing

Basic data type bool type, int type, double type, with assign

August 19, 2015 09:54:45

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.