Objective-C: 08 _ memory management_arc compiler features

Source: Internet
Author: User
Automatically generated code, not garbage collection Arc judgment criteria: As long as there is no strong pointer to the object, the object will be released   1. Features of Arc -Release, retain, and retaincount cannot be called. -"Dealloc can be rewritten, but [Super dealloc] cannot be called. -@ PROPERTY PARAMETER Strong: The member variable is a strong pointer (applicable to the OC object type) Weak: The member variable is a weak pointer (applicable to OC object types) Assign: Basic Data Type -Change the previous retain to strong.Pointers can be divided into two types: strong pointers: by default, all pointers are strong pointers (_ strong can be left blank by default) and two weak underlines: (_ weak) _ weak person * P = [[person alloc] init]; Use Case of weak: circular reference. When a circular reference occurs (a person has a dog and a dog has a master), you must use strong and weak. After the project uses arc, if a file does not want to use arc, in build phases → comlile sources, double-click this file and fill in the pop-up box: -Fno-objc-ArcIf the project is not an arc, and a file in it wants to use arc, double-click this file in build phases → comlile sources and fill in the pop-up box: -F-objc-Arc

Objective-C: 08 _ memory management_arc compiler features

Related Article

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.