Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storyboard returns nil need some quick advise how to instantiate

I run into the following problem. In my iPad app using storyboard.

-(UIViewController *)SetDetailVideoView
{
    // assign/instantiate self. storyboard, but how?
    VideosViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"VideoViewController"]; //empty but why? Because self.storyboard is empty
    NSLog(@"%@",self.storyboard); //NULL
    return vc;
}

Self.storyboard returns nil so everything it try to get return nil and gives an exemption? So how do i instantiate self.storboard.

like image 644
Msmit1993 Avatar asked Mar 23 '23 08:03

Msmit1993


1 Answers

Use below code to instantiate your storyboard

self.storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil];
like image 94
Hemant Singh Rathore Avatar answered Apr 23 '23 06:04

Hemant Singh Rathore