0

コンソールで「Received Memory Warning」が表示されることがあります。ここを参照してください:

2012-07-13 11:39:54.344 PROJ42 [25255:707] Received memory warning.  

アプリはクラッシュしません。しかし、私はこの警告を解決したいです。
この警告が表示されてレポートが送信される理由を調べる方法はありますか? はいの場合、どうすればそれを行うことができますか?

情報:私は、そのような警告を見つけるためにインストゥルメントを実行できることを知っています。しかし、エンドユーザーからのデバイスでこの警告をキャッチできるかどうか知りたいですか?

どうすればそのような警告をキャッチできますか?

4

3 に答える 3

2

UIViewControllerと呼ばれる上書きできるメソッドがあります:

- (void)didReceiveMemoryWarning

これは呼び出されるメソッドで、カスタム コードを記述できます。

于 2012-07-13T09:59:31.413 に答える
1

Memory warnings occurs due to usage of lots of Memory in your application. Try to release the memory.

于 2012-07-13T10:27:44.567 に答える
1

I think that there is no build-in way to know what happened...

You can try to save some indicative NSString for each place where you allocate new objects/open new resources (like "mainView::createNewImage => alloc" or "mainView::createNewImage => loading resource") and then make a NSLog of content of that string inside

- (void)didReceiveMemoryWarning

It may take time but can indicate you the place of problem.

于 2012-07-13T10:27:50.963 に答える