an appropriate low memory warning message on didreceivememorywarning !
I got frequently low memory warning in my app, i override didreceivememorywarninig method and tried my best to release unwanted custom objects.
Usually i got the memory warnings when multiple application running in background ( 6 to 7 apps) so i want to inform users to close some background开发者_StackOverflow社区 app that might help to run my app smoothly.
//Warning message:
//Warning: You are running low on memory. Closing other applications might help.
-(void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
NSString *WarningMessage = [NSString stringWithString:@"Warning: You are running low on memory. Closing other applications might help."];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"MyApp" message:WarningMessage delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
[alert release];
}
Will apple accept this behavior ???? Thanks.
good question, but I don't see any reason why apple should not accept this...
I am not sure if you should be suggesting that. iOS is going to purge them anyway. You should just handle the situation for your app.
It's an absolutely daft idea. It will confuse users and produce a bad user experience.
What you are missing is that it is intentional that you receive low memory warnings and eventually get killed when in the background. The other applications experience exactly the same behaviour. But the good thing is that if you did the right things when transitioning to the background, this will be not noticed by the user. To the user, it looks as if all these applications are still running. For example, apps receiving notifications in the background will still receive them, even when they are killed. And when they tap on your app, it starts again exactly where they left.
If the user manually kills an application, all this carefully designed behaviour is destroyed. Notifications are not received. The user loses the place in the application where they left off but start again from scratch when tapping the app. I would expect that Apple would reject your app if they find out what you are doing, because you aren't doing anyone any favours.
精彩评论