1

I am not able to include the particular controller inside my code but other controllers are included, I included the controller as header but I am not able to include it inside. I attach my code here, I am not able to include IndexPageTableViewController as favoritesViewController?

#import "IndexPageTableViewController.h"
#import "FavoritesViewController.h"

-(void) navigateToFavorites
{
 UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main_iPhone"
                                                         bundle: nil];
if(mainStoryboard)
{
    FavoritesViewController *favorites = (FavoritesViewController *) [mainStoryboard instantiateViewControllerWithIdentifier:@"FavoritesViewController"];
    [[SlideNavigationController sharedInstance ] popToRootAndSwitchToViewController:favorites withSlideOutAnimation:NO andCompletion:^{
        [self initTableView];
    }];
}
}

1 Answers1

1

As you mentioned in comment that you are getting signal sigabrt error that means you may not set FavoritesViewController as identifier in interface builder. you can set Storyboard ID under identity under Identity Inspector. Custom class and storyboard id both are different thing. I think FavoritesViewController is your class that you have set from identity inspector. If you want to instantiate storyboard then you have to set storyboard id and then you can use that id to instantiate view controller.

Second thing make sure that your storyboard's name is correct and your view controller is within this storyboard. And you have make proper setup if you are using multiple storyboard.

Ketan Parmar
  • 27,092
  • 9
  • 50
  • 75