Note that there are some explanatory texts on larger screens.

plurals
  1. POChange TabBarItem text in WindowBased app
    text
    copied!<p>I create window based app (call it TabBar). In TabBarAppDelegate I create two UIViewControllers and one UITabBarController.</p> <pre> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. UIViewController *vc1 = [[UIViewController alloc] initWithNibName:@"MyFirstViewController" bundle:nil]; UIViewController *vc2 = [[UIViewController alloc] initWithNibName:@"MySecondViewController" bundle:nil]; NSArray *contr = [NSArray arrayWithObjects:vc1, vc2, nil]; UITabBarController *tbc = [[UITabBarController alloc] init]; tbc.viewControllers = contr; [self.window addSubview:tbc.view]; [self.window makeKeyAndVisible]; [vc1 release]; [vc2 release]; return YES; }</pre> <p>In MyFirstViewController.xib I create uilabel (using IB for test that view is loaded) and for MySecondViewController.xib too.</p> <p>And app build and run successful, but uitabbaritem - without image and title. I tried to add in MyFirstViewController.m this lines for set title and image of MyFirstViewController</p> <pre> - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"first" image:[UIImage imageNamed:@"first.png"] tag:0]; self.tabBarItem = item; [item release]; } return self; } </pre> <p>But first tabbaritem isn't change. Help me please. I don't understand what I'm doing wrong.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload