0

i've external xib which is embeded in my uiscrollview in storyboard. In xib, i've a uibutton which needs to push another viewcontroller but its not working

[self presentViewController:revealController animated:YES completion:nil];

OR

[self.navigationController pushViewController:punchVC animated:YES]

both are not working, any idea?

  • Please do some RnD first on stack overflow, this kind of questions have been asked before. Please refer this link : http://stackoverflow.com/questions/13987026/ios-push-viewcontroller-from-code-and-storyboard – Tushar J. Sep 14 '15 at 10:07
  • check for your self.navigationController value in the debug. If it is nil you will not be able to push your VC. Make sure you have a navigation View Controller before pushing a new VC – Pavan Kotesh Sep 14 '15 at 10:07
  • thank you for your suggestion, but yes i already did R&D and yes i 'd instantiate the viewcontroller, but its not working – user1495387 Sep 14 '15 at 10:09

1 Answers1

0

thanks guys for the time, whoever find this problem, i got the solution. You need to use protocol from your embeded xib to the main storyboard controller.