小编Rya*_*van的帖子

如何正确设置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];
}
Run Code Online (Sandbox Code Playgroud)

我认为这是你正确设置推动控制器的标题的方式.我尝试了thing.title但是设置了TabBarItem的标题.

iphone uitabbarcontroller uinavigationcontroller ios

5
推荐指数
1
解决办法
2万
查看次数