加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – ARC是否会为您释放内存错误?

发布时间:2020-12-16 05:59:35 所属栏目:百科 来源:网络整理
导读:自动引用计数释放已分配的Objective-C对象.原始变量如char *? 解决方法 不是 llvm document on ARC Automatic Reference Counting implements automatic memory management for Objective-C objects and blocks,freeing the programmer from the need expli
自动引用计数释放已分配的Objective-C对象.原始变量如char *?

解决方法

不是 llvm document on ARC

Automatic Reference Counting implements automatic memory management for Objective-C objects and blocks,freeing the programmer from the need explicitly insert retains and releases. It does not provide a cycle collector; users must explicitly manage lifetime instead.

A retainable object pointer (or retainable pointer) is a value of a retainable object pointer type (retainable type). There are three kinds of retainable object pointer types:

  • block pointers (formed by applying the caret (^) declarator sigil to a function type)
  • Objective-C object pointers (id,Class,NSFoo*,etc.)
  • typedefs marked with __attribute__((NSObject))

Other pointer types,such as int* and CFStringRef,are not subject to ARC’s semantics and restrictions.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读