Reputation: 1710
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
.
Upvotes: 4
Views: 5189
Reputation: 3455
I don't like the hard coded style. You can also use:
[self.navigationController.storyboard instantiateViewControllerWithIdentifier:@"VideoViewController"];
Upvotes: 2
Reputation: 2139
Use below code to instantiate your storyboard
self.storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil];
Upvotes: 5