here's my problem. i couldn't set the name for my navigationBar.. below are some i have tried but to no avail.
- (void)viewDid开发者_JAVA技巧Lload {
[super viewDidLoad];
self.title = @"Food";
}
- (void)viewDidLload {
[super viewDidLoad];
[self.setTitle:@"Food"];
}
- (void)viewDidLload {
[super viewDidLoad];
MyTableViewController *myTableViewController = [[MyTableViewController alloc] init];
myTableViewController = @"Food";
}
any kind soul?
Assuming this code is exactly like it is in your project, you mispelled the method name. Try this:
- (void) viewDidLoad {
self.title = @"Food";
}
Also, the last two examples are just plain wrong.
make sure you have the navigation bar as a referencing outlet in IB, name with navBar or what ever you like, then in the code just add the line: [[navBar topItem] setTitle:@"title with code"];
精彩评论