I currently have my navigation controllers defined in my appDelegate as followed (code summarized):
- (void) applicationDidFinishLaunching {
tabBarController = [[UITabBarController alloc] init];
FlagList *flagList = [[FlagList alloc] initWithApiCall:API_PUBLICTIMELINE andTitle:@"Home"];
UITabBarItem *homeTab = [[UITabBarItem alloc] initWithTitle:@"Home"
image:[UIImage imageNamed:@"home.png"]
tag:0];
flagList.tabBarItem=homeTab;
[homeTab release];
tabBarController.viewControllers=[NSArray arrayWithObjects:flagList,nil];
[flagList release];
[rootViewController release];
rootViewController = [[UINavigationController alloc] initWithRootViewController:[tabBarController autorelease]];
rootViewController.navigationBar.barStyle=UIBarStyleDefault;
}
I want to set a title in the navigationBar of my FlagListView. HOWEVER, I want to be able to do this in the -viewDidLoad method of my FlagList UITableViewController class. How can I access this property?
I tried:
[[self navigationItem] setTitle:@"Home"];
..but it doesn't seem to work. Can someone please tell me what I'm doing wrong?