What to do when my app receives memory warning?

后端 未结 4 403
说谎
说谎 2021-01-12 13:21

What should I do when my app recieves a memory warning?

4条回答
  •  广开言路
    2021-01-12 14:06

    It really depends on your app.

    If your app downloads and caches lots of contents from Internet for example, you should purge as much as possible when receiving a warning.

    If your app is an OpenGL game, you might have a texture/sound/data manager which references some unused data, which you then want to free. Cocos2D manages this kind of things.

    If your app isn't memory intensive, you have a memory leak somewhere, and you should 1) read the Memory Management Programming Guide by Apple 2) use Instruments/Leaks.

提交回复
热议问题