私の会社のiPhoneアプリケーションを開発中です。私は奇妙なことに遭遇しました。 UINAvigationControllerを含むすべてのタブと5つのタブを含むpresentModalViewController - プレビュー後にViewControllerが自動的に消えます
UITabBarController:
マイビューHierachyは、このようになります。 これまでのところすべてが完璧に機能します。
今、私はこのコードの行を使用して UITabBarControllerにpresentModalViewControllerメソッドを介してモーダルビューコントローラを提示したい:
-(void)callFilterOptions
{
FilterOptionsView *filterView = [[FilterOptionsView alloc] init];
[filterView setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self.tabBarController presentModalViewController:filterView animated:TRUE];
}
FilterOptionsViewは 現時点では黒の背景しか含まない通常のUIViewControllerであります。
何が起こるかは、ビューが表示され、数秒後に謎めいて消えることです。 なぜこれが起こっていますか?いいえ、私はdismissModalViewControllerメソッドを呼び出しています。
メールコンポーザーを提示するとき、すでにこの問題に遭遇しました。
挨拶、 フロリアン
[self.view presentModalViewController:filterView animated:TRUE]のself.tabBarControllerを変更してみてください。 – oriolpons
同じエラーが発生します。そして私は[self presentModalViewController:filterView animated:TRUE]を試したので、ビューからモーダルビューコントローラを表示できません。 – user1197467
あなたはARCを使用していますか?クラス変数としてfilterViewを作成しようとしてください – Chakalaka