我想下面的代碼:如何正確設置UIViewController的navigationController標題?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
Thing *sub = [[subscriptions objectAtIndex:indexPath.row] retain];
StoriesViewController *thing = [[StoriesViewController alloc] initWithThing:sub];
thing.navigationController.title = sub.title;
[self.navigationController pushViewController:thing animated:YES];
[thing release];
[sub release];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
我認爲你這是怎麼正確設置標題爲推動控制器。我試過thing.title,不過那是設置TabBarItem的標題。
這裏更深入的討論:http://stackoverflow.com/questions/2280710/iphone-setting-navigation-bar-title – 2012-06-11 14:59:49