我切换第一个tabbaricon的标签名,如下所示:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
NSString *temp = [[NSUserDefaults standardUserDefaults] stringForKey:@"stateOfSwitch"];
if ([temp isEqualToString:@"OFF"]) {
self.title = NSLocalizedString(@"TabButtonOFF", nil);
}
else {
self.title = NSLocalizedString(@"TabButton1", nil);
}
self.tabBarItem.image = [UIImage imageNamed:@"first"];
}
return self;
}
它可以通过启动和停止应用程序正常工作,但有没有办法刷新(重新加载)标签名? 到运行时?