私はこれに問題があります。私のルートView Controllerには、テキストフィールドと1つのボタンがあります。テキストフィールドに 0 を入力した場合のみ、次のビューに移動する必要があるという条件を与えています。ここまでは正常に動作しています。しかし、ここで問題が発生します。ここでは、1 つのボタンと、そのボタンの 3 番目のビュー コントローラーへのナビゲーションを指定しています。ここで私はエラーが発生しています
Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
画像参照: http://img12.imageshack.us/img12/8533/myp5.png
そして、私は以下のように最初のビューでボタンにアクションを与えています
- (IBAction)Submit:(id)sender {
if([tf.text isEqual:@"0"])
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
SecondViewController *vc2 = [storyboard instantiateViewControllerWithIdentifier:@"SecondViewControllerID" ];
[self presentViewController:vc2 animated:YES completion:NULL];
}
}