-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot set title #3
Comments
I tried all the ways as outlined here: http://stackoverflow.com/questions/6154237/how-to-set-the-title-of-a-navigation-bar-programatically |
So the issue here is that the navigation item you need to address is only actually relative to the view immediately contained in the UINavigationViewController, ie the StoryboardXIBController. If you grab the StoryboardXIBController in your sub-ViewController you should be able to assign its navigation item properly in your sub-ViewController. LSPopoverViewController.h @interface LSPopoverViewController : UIViewController<StoryboardXibContainedController>
... LSPopoverViewController.m ...
- (void)storyboardXibLoadedBy:(StoryboardXibController *)storyboardXibController
{
storyboardXibController.navigationItem.title = @"Popover View Controller";
}
... Or other than assign it directly in Let me know if this works! This seems like a pretty common thing that people will want to do, I'll think about a simpler way to get the navigation item of the StoryboardXIBController. |
Hmmm. It's definitely very useful. I think I could work with that — it's a pretty leaky abstraction though, since the View Controller will now need to know about the fact that it's been loaded by a
|
I agree completely, I'll try to think of a cleaner solution, again let me know if you come up with something! Yea, UIViewControllers in general are very contradictory, in no small part by their exposure and access to the navigation view and items ;) |
Created issue #4 |
I've got a storyboard set up, linked to a XIB:
I'm trying to override the title given in the storyboard programmatically from the view controller but not having much luck:
WRONG TITLE still shows. How comes?
The text was updated successfully, but these errors were encountered: