gpt4 book ai didi

objective-c - 如何在特定标签栏上打开应用程序? iOS Objective-C

转载 作者:行者123 更新时间:2023-12-01 17:27:14 25 4
gpt4 key购买 nike

我正在尝试在第三个标签栏而不是第一个标签栏上打开该应用程序。无论我将应用程序放在标签栏上的顺序如何,左侧的第一个始终会首先打开。有人可以帮忙吗?以下是标签条码。

 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.

UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];

UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];

UIViewController *viewController3 = [[ThirdViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil];

UIViewController *viewController4 = [[FourthViewController alloc] initWithNibName:@"FourthViewController" bundle:nil];

UITableViewController *viewController5 = [[FifthViewController alloc] initWithNibName:@"FifthViewController" bundle:nil];


self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController3, viewController4, viewController1, viewController2, nil];
self.window.rootViewController = self.tabBarController;

最佳答案

你试过了吗

[self.tabBarController setSelectedIndex:2];

关于objective-c - 如何在特定标签栏上打开应用程序? iOS Objective-C,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10133115/

25 4 0