iPhone 内存管理的最佳解释在哪里? [英] Where are the best explanations of memory management for iPhone?

查看:25
本文介绍了iPhone 内存管理的最佳解释在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找好的解释.我有一本关于 Objective-c 的 1000 页书,但不幸的是,关于内存管理、保留计数的部分描述得非常糟糕且难以理解.

I am looking for good explanations out there. I have a 1000 pages book about objective-c, but unfortunately the part about memory management, retain counting, is described pretty bad and hard to understand.

推荐答案

快速解释:任何你分配保留复制,您还必须发布.此外,如果您打算在当前消息循环之外保留它(或者您冒着将其自动发布并成为无效引用的风险),那么您应该保留任何您没有分配或复制的内容.

A quick explaination: Anything you alloc, new, retain or copy you must also release. Also, anything you DON'T alloc or copy you should retain if you plan on holding on to it beyond the current message loop (or you risk it being autoreleased and becoming an invalid reference).

这篇关于iPhone 内存管理的最佳解释在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆