To switch views in the storyboard, I'm using this code. This is in the
viewDidLoad
on the main screen:
x1ViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil]
instantiateViewControllerWithIdentifier:@"x1ViewController"];
Well, there's your problem. viewDidLoad
is way too soon. You aren't even in the interface yet and already you are trying to move to the next state of the interface. Moreover, you are running the risk of trying to present the same view controller instance on different occasions.
Move that code to your button-press code. You don't need this view controller instantiated until the moment comes when you present it. Use a new view controller instance each time you present.