I am using a storyboard to switch between views. Pretty simple, until I try to add ECSlidingViewController.
If I add the above slide menu to the first view I call using this:
self.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Main"];
If I set @"Main" to @"Speakers", the view loads just fine. I get the slide menu and everything. @"Main" also loads just fine.
However, if I load @"Main" first like in the code above, then switch views to the one I've designated "Speakers", it crashes as soon as I try to call the slide menu with this code:
if(![self.slidingViewController.underLeftViewController isKindOfClass:[MenuViewController class]]) {
self.slidingViewController.underLeftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Menu"];
}
[self.view addGestureRecognizer:self.slidingViewController.panGesture];
I get a crash stating: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
I have tried switching views numerous ways.
I've tried:
SpeakersView *second= [self.storyboard instantiateViewControllerWithIdentifier:@"Speakers"];
[self presentViewController:second animated:YES completion:nil];
I've tried:
SpeakersView *svc = [self.storyboard instantiateViewControllerWithIdentifier:@"Speakers"];
[self presentViewController:svc animated:YES completion:nil];
Each one works just fine if I don't call up the slide menu, but each causes a crash when I do add the slide gesture.
Ideas?