Oc--arc use

Source: Internet
Author: User

ARC's judging criteria; If no strong pointer points to the object, the object is freed

1.ARC Features
1> does not allow calls to release, retain, Retaincount
2> allows rewriting of dealloc, but does not allow calls to [super Dealloc]
Parameters of the 3> @property
*strong: Strong pointer for member variable (for OC object type)
*weak: Weak pointer for member variable (for OC object type)
*assign: For non-OC object types
4> former retain changed to strong

-fno-objc-arc turn into non-arc
-f-objc-arc turn into Arc

When both ends are circular references, the solution:

1>arc
One end with strong, the other end with weak
2> Non-Arc
One end with retain, the other end with assign



The hands are divided into 2 types:
1. Strong pointer: By default, all pointers are strong pointers _strong
2. Weak pointer: _weak

Oc--arc use

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.