ios - 'Push segues can only be used when the source controller is managed by an instance of UINavigationController -


i having problem this. in root view controller having textfield & 1 button. giving condition if entered 0 in textfield should move next view. upto here working correctly. here problem. here having 1 button & given navigation third view controller button. here getting error as

terminating app due uncaught exception 'nsgenericexception', reason: 'push segues can used when source controller managed instance of uinavigationcontroller.' 

image ref: http://img12.imageshack.us/img12/8533/myp5.png

and giving action button in first view below

- (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];  }   } 

after looking @ screenshot, either need to

  1. push secondviewcontroller onto existing navigation controller's stack instead of presenting modally or
  2. you need embed secondviewcontroller in navigation controller , create , present that navigation controller modally samplesviewcontroller

either way, secondviewcontroller needs embedded in navigation controller before can use push segues it


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -