iPhone开发 - iphone应用程序的内存限制 [英] iPhone Development - Memory limitation for iphone application

查看:115
本文介绍了iPhone开发 - iphone应用程序的内存限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以在这里指出正确的方向。我想在我的应用程序收到内存警告时响应(我想知道如何响应此通知)。另外,我可以用我的应用程序连接多少内存?

Can anyone point into the right direction here. I want to respond when my application receives memory warning, (i want to know how to respond to this notification). Plus, How much memory can i wire with my application?

任何文章或书籍参考都会很棒。谢谢。

Any articles or book reference would be great. Thanks.

推荐答案

如果你的应用收到内存警告(例如你的视图控制器的 didReceiveMemoryWarning 方法)您需要释放任何非关键数据。例如,任何您正在使用的缓存,或者可以重新生成的东西都应该被转储。

If your app gets a memory warning (such as in your view controller's didReceiveMemoryWarning method) you need to release any non-critical data. Anything that you're using that cached, for example, or that can be regenerated, should be dumped.

例如,如果您的应用程序处理某些数字并存储结果在一个大数组中,如果你没有主动使用那个数组,你应该释放它。然后,再次需要时重新生成它。

For example, if your app crunches some numbers and stores the result in a big array, if you're not actively using that array, you should release it. Then, regenerate it when you need it again.

这里有更多信息:
观察内存不足警告

这篇关于iPhone开发 - iphone应用程序的内存限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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