【发布时间】:2012-10-05 10:59:01
【问题描述】:
目前我正在使用 iPhone 应用程序,我有四个屏幕,如登录、A、B 和 c 等。 用户在登录屏幕输入用户名和密码字段,然后按登录按钮
-(void)LoginButtonMethod
{
A *a = [[A alloc]init];
B *b = [[B alloc]init];
C *c = [[C alloc]init];
UINavigationController *navi1 = [[UINavigationController alloc] initWithRootViewController:a];
UINavigationController *navi2 = [[UINavigationController alloc] initWithRootViewController:b];
UINavigationController *navi3 = [[UINavigationController alloc] initWithRootViewController:c];
UITabBarController *TabBar = [[UITabBarController alloc] init];
TabBar.delegate = self;
TabBar.viewControllers = [NSArray arrayWithObjects:navi1, navi2, navi3, nil];
navi1.tabBarItem.title=@"A";
navi2.tabBarItem.title=@"B";
navi3.tabBarItem.title=@"C";
[self.navigationController pushViewController:TabBar animated:YES];
}
然后我为每个类设置导航栏标题,例如 A 为 facebook,b 为 yahoo,c 为 google。
最后我运行应用程序,标签栏标题显示在 A,B,C 然后我选择第三个标签栏项目(C),当时标签栏标题更改谷歌。 我无法解决这个问题,请帮助我。
提前致谢
【问题讨论】:
-
我很困惑,你想让第三个名字(根据你的 C)作为谷歌来吗?
-
您是否在 View Did Load 中为每个控制器设置了 self.title = @"Your Title" 可能这会解决您的问题。或者你可以只为你遇到问题的 ViewController 添加
-
这应该可以检查两个类中的断点。
标签: iphone ios uinavigationbar title tabbar