タグ付けされた質問 「dismissviewcontroller」

6
モーダルビューコントローラー-表示と非表示の方法
複数のViewControllerの表示と非表示に関する問題を解決する方法について、この1週間頭を悩ませています。サンプルプロジェクトを作成し、プロジェクトから直接コードを貼り付けました。3つのViewControllerとそれに対応する.xibファイルがあります。MainViewController、VC1およびVC2。メインビューコントローラーに2つのボタンがあります。 - (IBAction)VC1Pressed:(UIButton *)sender { VC1 *vc1 = [[VC1 alloc] initWithNibName:@"VC1" bundle:nil]; [vc1 setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal]; [self presentViewController:vc1 animated:YES completion:nil]; } これにより、VC1が問題なく開きます。VC1には、VC1を閉じると同時にVC2を開く必要がある別のボタンがあります。 - (IBAction)buttonPressedFromVC1:(UIButton *)sender { VC2 *vc2 = [[VC2 alloc] initWithNibName:@"VC2" bundle:nil]; [vc2 setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal]; [self presentViewController:vc2 animated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil]; } // This shows a warning: Attempt to dismiss from …
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.