ユーザーがピッカーホイールから国を選択するアプリがあります。アラートが表示され、変更を確認するように求められます。確認すると、別のビューに移動し、カテゴリのリストから選択して情報を表示できます...
カテゴリのリストはナビゲーションコントローラに埋め込まれており、詳細ビューの「戻る」からカテゴリ選択ビューに簡単に移動できます。
アプリ全体がタブバーコントローラーに埋め込まれています。
[国を選択すると、[カテゴリの選択]画面が表示されます)、[カテゴリの選択]がタブバーコントローラーへの接続を失い、アプリの他の部分に戻る方法がないことを除いて、正常に機能します。
これが私のalertViewコードです:
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
NSLog(@"ok");
//I tried the following but it doesn't do anything
//SelectCategory *switchtocategory = [[SelectCategory alloc] init];
//[self.navigationController pushViewController:switchtocategory animated:YES];
//the following works but loses the tab/navigation bars
[self performSegueWithIdentifier: @"GoToCategory" sender: self];
} else {
NSLog(@"cancel");
}
}