I need to set some UI elements of an UIViewController from AppDelegate. I use a Storyboard, so the UIViewController don't become initialized in AppDelegate.
I try to get the instance of UIViewController with:
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]];
TableViewController* myTableViewController = [storyboard instantiateViewControllerWithIdentifier:@"myTableViewController"];
But when I try to set some UI element like the UIBarButtonItem of the UINavigationBar, like here:
UIBarButtonItem* refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshEntry)];
myTableViewController.navigationItem.rightBarButtonItem = refreshButton;
the UINavigationBar stay blank and the UIBarButtonItem don't appear...
How can I change the UI?