我在我的應用程序經常內存不足的警告,我重寫didreceivememorywarninig方法和盡我所能釋放不要自定義對象。適當的低內存didreceivememorywarning警告信息!
通常我得到了內存不足警告時,在後臺(6至7的應用程序)的多個應用程序的運行,所以我希望通知用戶到關閉一些後臺程序,這可能有助於平穩運行我的應用程序。
//警告消息:
//警告:您是在內存不足。關閉其他應用程序可能有幫助。
-(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];
}
將蘋果接受這種行爲???? 謝謝。