Rya*_*van 5 iphone uitabbarcontroller uinavigationcontroller ios
我正在尝试以下代码:
- (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的标题.
jam*_*pag 19
thing.navigationItem.title = sub.title;
Run Code Online (Sandbox Code Playgroud)
或者在viewDidLoad方法中的StoriesViewController.m文件中:
self.navigationItem.title = sub.title
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16492 次 |
| 最近记录: |