アプリでメモリ不足の警告が頻繁に発生しました。didreceivememorywarninigメソッドをオーバーライドし、不要なカスタムオブジェクトを解放するために最善を尽くしました。
通常、複数のアプリケーションがバックグラウンドで実行されている場合(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];
}
アップルはこの動作を受け入れますか???? ありがとう。