self.title sets navigationController and tabBarItem's title? Why?

后端 未结 4 1561
孤城傲影
孤城傲影 2020-11-30 19:15

I do this in a UIViewController for one of my tabs:

self.title = @\"Welcome\";

However, it\'s overwriting whatever I have for the tabBarIte

4条回答
  •  攒了一身酷
    2020-11-30 19:42

    Try:

    [self setTitle:@"Welcome"];
    
    UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"Home" image:[UIImage imageNamed: image] tag:0];
    [self setTabBarItem:item];
    [item release];
    

提交回复
热议问题