Reputation: 169
Example without storyboard:
AppDelegate.h
@property (retain, nonatomic) UIViewController *leftController;
AppDelegate.m
self.leftController = [[LeftViewController alloc] initWithNibName:@"LeftViewController" bundle:nil];
OtherViewController:
//This is what I want do to in storyboards
self.viewDeckController.leftController = (AppDelegate*)[[UIApplication sharedApplication] delegate].leftController;
How can I get that instance of leftController when using storyboards?
Upvotes: 9
Views: 20341
Reputation: 3805
I am not sure whether you able to get solutions of this problem or not, but you can also refer the answer of this question :
Accessing view controller form a storyboard
Upvotes: 0
Reputation: 130183
You can give the view controller an identifier in interface builder, then simply use:
UIStoryboard *mystoryboard = [UIStoryboard storyboardWithName:@"myStoryBoardName" bundle:nil];
self.leftController = [mystoryboard instantiateViewControllerWithIdentifier:@"idyouassigned"];
Upvotes: 28