现在的位置: 首页 > 综合 > 正文

OC内存管理之release

2018年05月05日 ⁄ 综合 ⁄ 共 534字 ⁄ 字号 评论关闭

Release释放

Releases a Core Foundation object.

void CFRelease (
   CFTypeRef cf
);
Parameters

A CFType object to release. This value must not be NULL.

Discussion

If the retain count of cf becomes zero the memory allocated to the object is deallocated and the object is destroyed. If you create, copy, or explicitly retain (see the CFRetain function)
a Core Foundation object, you are responsible for releasing it when you no longer need it (see Memory
Management Programming Guide for Core Foundation
).

如果CF保留计数变为零,分配给对象的内存被释放,该对象将被破坏。如果你创建,复制或明确保留(见CFRetain功能)核心基础的对象,你是负责释放它,当你不再需要它(请参阅内存管理编程指南的Core
Foundation

抱歉!评论已关闭.