Search code examples
iphoneviewdeck

IIViewDeckController crashing when switching viewcontroller


I have got a IIViewDeckController set up to replicate the facebook app funcionaly

ViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
EditSettingsViewController *evc = [self.storyboard instantiateViewControllerWithIdentifier:@"EditSettingsViewController"];
IIViewDeckController* deckController =  [[IIViewDeckController alloc] initWithCenterViewController:vc leftViewController:evc                                                                                rightViewController:nil];

In order to switch, I have got a tableview that calls different methods.

When I switch the center controller to a new controller it crashes:

MyTableViewController *mvc = [self.storyboard instantiateViewControllerWithIdentifier:@"MyTableViewController"];

[self.viewDeckController setCenterController:mvc];

But when I do exactly the same to the initial center viewcontroller it doesn't crash.

I have also noticed, that when I reset all the content in the simulator I am able to switch once to the new controller without crashing.

It doesn't show any warning. Just the following:

ERROR


Solution

  • Solved my issue.

    In the initial Controller I was using the viewdeckDelegate and implementing a few methods. When switching to the new viewcontroller, I wasn't defining the delegate when those methods where being called.