ARC-数据类型需要释放的情况

// Foundation :  OC
// Core Foundation : C语言
// Foundation和Core Foundation框架的数据类型可以互相转换的

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

// Core Foundation中手动创建的数据类型,都需要手动释放
//    CFArrayRef array = CFArrayCreate(NULL, NULL, 10, NULL);
//    CFRelease(array);
//
//
//    CGPathRef path = CGPathCreateMutable();
//    CGPathRetain(path);
//
//    CGPathRelease(path);
//    CGPathRelease(path);
/**
 凡是函数名中带有createcopy ew etain等字眼, 都应该在不需要使用这个数据的时候进行release
 GCD的数据类型在ARC环境下不需要再做release
 CF(Core Foundation)的数据类型在ARCMRC环境下都需要再做release

原文地址:https://www.cnblogs.com/nxz-diy/p/5365435.html