iPhone Development - Memory limitation for iphone application

前端 未结 2 1448
你的背包
你的背包 2020-12-02 02:20

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, Ho

2条回答
  •  鱼传尺愫
    2020-12-02 02:33

    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.

    A little more information is here: Observing Low-Memory Warnings

提交回复
热议问题