我在视图控制器中使用标签栏,并在“viewDidLoad”方法中声明它:
normalView =[[NormalViewController alloc] initWithSigne:[[normalAstro objectAtIndex:signIndex]objectForKey :@"name"] andDescription:[[normalAstro objectAtIndex:signIndex]objectForKey :@"description"]] ;
[controllers addObject:normalView];
chineseIndex=[self searchChineseIndex];
chineseView =[[ChineseViewController alloc] initWithSigne:[[chineseAstro objectAtIndex:chineseIndex]objectForKey :@"name"] andDescription:[[chineseAstro objectAtIndex:chineseIndex]objectForKey :@"description"]] ;
[controllers addObject:chineseView];
tabBar = [[UITabBarController alloc] init];
tabBar.viewControllers=controllers;
[self.view addSubview:tabBar.view ];
和放在 tabBar 中的 viewControllers 我写这个来初始化它们:
[self.tabBarItem setTitle:@"signe astral" ] ;
tabBarItem 的标题没有为我出现的问题,所以我的问题是我在这一切中的错误在哪里?