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

查看:131
本文介绍了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天全站免登陆