If the ARC data type needs to be released, the arc data type is released.

Source: Internet
Author: User

If the ARC data type needs to be released, the arc data type is released.

// Foundation: OC
// Core Foundation: C Language
// The Data Types of the Foundation and Core Foundation frameworks can be converted to each other.

// NSString * str = @ "123"; // Foundation
// CFStringRef str2 = (_ bridge CFStringRef) str; // Core Foundation
// NSString * str3 = (_ bridge NSString *) str2;
// CFArrayRef ---- NSArray
// CFDictionaryRef ---- NSDictionary
// CFNumberRef ---- NSNumber

// Manually release all manually created data types in Core Foundation
// CFArrayRef array = CFArrayCreate (NULL, NULL, 10, NULL );
// CFRelease (array );
//
//
// CGPathRef path = CGPathCreateMutable ();
// CGPathRetain (path );
//
// CGPathRelease (path );
// CGPathRelease (path );
/**
All the words "create \ copy \ new \ retain" in the function name should be release when this data is not needed.
The data type of GCD does not need to be release in the ARC environment.
The data type of CF (Core Foundation) must be release in the ARC \ MRC environment.

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.