I get the following error when I try to switch views like this:
-(void)changeView1ToView4 { [self.navigationController1 pushViewController:view4 animated:YES]; }
This does not happen when the application loads, and the user goes directly to this view. This failure occurs only when I go to one of my other views, return to the main menu, and then try to go to this view.
Also, if you were not sure already, I use the UINavigationController. Also, this code is in the application delegate, and I call it from the view controller, which has a parent view, so I use the. Link to call it like this:
[self.reference changeView1ToView4]
Is there any real way to fix this?
Thanks!
Edit1:
[self.navigationController1 pushViewController:view4 animated:NO]; [self.navigationController1 pushViewController:view4 animated:YES]; I tried that and got this crash message in the console: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing the same view controller instance more than once is not supported (<View2: 0x18d540>)'
source share