setting Title for navigation bar in xcode
ios, objective-c, uitableview, xcode
Solution
Try initializing your navigation controller this way:
UINavigationController *addViewControl = [[UINavigationController alloc] initWithRootViewController:addView];
[self presentModalViewController:addViewControl animated:YES];
//[addView release];
//[addViewControl release]; // uncomment these two lines if not using ARC
And then set the `title` property of your `addViewController` class in the `viewWillAppear` method.
Problem
I have created a navigation controller programmatically, ``` //Creating AddViewController Object addViewController *addView = [[addViewController alloc]init]; UINavigationController *addViewControl = [[UINavigationController alloc]init]; [addViewControl.view addSubview:addView.view]; [self presentModalViewController:addViewControl animated:YES]; ``` But when i add self.title = @"Title" in addViewController class. it is not displaying. i tried with the following, ``` self.navigationItem.title = @"Title"; self.navigationController.navigationBar.topItem.title = @"Title"; ``` But it's not displaying Title. I think it is possible to do with setting a label. but the above one is direct method. Any Idea..