I’ve been experiencing crashes in trying to load my CafesViewController. I have all the identifiers I know of in file inspector set to CafesViewController, and also checked “Use storyboard ID.”
My main menu View loads perfectly because it is defined as the default storyboard in my plist, however, there is a disconnect in loading the Cafes option when the button is pressed to load my Cafes listing (my app is a city directory of things to do).
My current code is:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([mlabel.text isEqualToString: @" Cafés " ])
{
UIStoryboard *cafesViewController = segue.destinationViewController;
cafesViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"CafesViewController"];
}
}
If someone can offer input, I would greatly appreciate it as I don’t know where the disconnect is. The error, of course, reads “‘NSInvalidArgumentException’, reason: ‘Storyboard () doesn’t contain a view controller with identifier ‘CafesViewController’
I’m thinking my call to action is wrong, but can someone give me their input?
Thank you!
I resolved my question with the following simple code:
In research, I learned that I could do what I wanted simply through the sample with the button specified above, rather than PrepareForSegue. Very easy.