brush51
brush51

Reputation: 5771

How to catch warning in app for Crash reporting: Received Memory Warning

sometimes i am facing a "Received Memory Warning" in Console. see here:

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

The app doesnt crash. But i want to solve this warning.
Is there a way to find out why i am getting this warning and sending a report? if yes, how can i do that?

Information: i know that i can run with instruments to find such warnings. But i want to know if it is possible to catch this warning on a device from enduser?

How can i catch such warnings?

Upvotes: 0

Views: 1188

Answers (3)

Shebuka
Shebuka

Reputation: 3228

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.

Upvotes: 1

Lion
Lion

Reputation: 872

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

Upvotes: 1

werner
werner

Reputation: 859

In UIViewController there is a method you can overwrite that is called :

- (void)didReceiveMemoryWarning

This is the method that gets called and in which you can write your custom code.

Upvotes: 2

Related Questions