I've seen some apps that generate a warning when low memory is detected. I tried to do this in my app but ran into a problem. Using the simulator to simulate a memory warning, the alert generated pops up twice before I can hit "ok" and pops up 9 more times after that times before it finally goes away.
Is it a bad idea to generate an alert when didReceiveMemoryWarning is called?
If not, is there a better way to do this than what I have below?
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
...
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Warning"
message:@"Your device is low on memory..."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
}
Thanks,
phil