私はメインビューコントローラと設定ビューコントローラを持つiPadアプリを持っています。メインビューに設定ビューが表示されたら、設定ビューをフルスクリーンで表示します。メモリ警告が発生するまで、動作する設定ビューには却下ボタンがあります。設定ボタンがオンスクリーンになっている間にメモリ警告が発生すると、警告を消すことを拒否します。言い換えればメモリ警告が表示されているView Controllerを破壊しますか?
、この作品:
- アプリケーションの起動を - >ショーメイン表示 - >表示設定表示 - > [設定]ビュー を閉じ
これはしていません:
- アプリケーション起動 - >メインビュー表示 - >設定表示 - >メモリ警告 - >設定解除表示
設定ビューはそのまま残ります。
私は、第1世代のiPadのiOS 5でこのアプリケーションを実行しています。 (私はiOS 4をサポートしていません)
どうすればこの問題を解決できますか?
編集:
- (void) showSettings{
if (!self.settingsViewController) {
//Create the navigation controller and the root view for the settings panel
SettingsViewController *settingsRootView = [[SettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
UINavigationController *settingsView = [[UINavigationController alloc] initWithRootViewController:settingsRootView];
[settingsRootView release];
//Configure the animation and modal style, and the navigation bar's color
[settingsView.navigationBar setTintColor:kDarkGrayColor];
//Enable the settings flag
[self setSettingsIsActive:YES];
//Configure the presentation
[settingsView setModalPresentationStyle:UIModalPresentationFullScreen];
[settingsView setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
self.settingsViewController = settingsView;
[settingsView release];
}
//present and release the settings panel
[self presentViewController:self.settingsViewController animated:YES completion:^{
}];
}
そして、ここで私はそれを隠す方法は次のとおりです:
ここに私のコードは設定を示すためだが表示
//This method reloads some stuff and
- (void) dismissSettings{
//
// ... Reload some other stuff...
//
//Dismiss the settings panel
[self dismissViewControllerAnimated:YES completion:^{
//
// ... Reload some other stuff...
//
}];
}
あなたにメモリ警告を与えていることを発見しましたか? didReceiveMemoryWarningの中で何かしていますか? – Rob
@Rob - NopeとNope。 – Moshe