Я делаю приложение, но я все еще новичок, и я пытаюсь привыкнуть к RootViewController и как его установить.TabBarController and NavigationController
В начале запускается мое приложение, я хочу, чтобы там был вид, который не находится в моем tabBarController (который установлен как мой rootViewController).
То, что я пытаюсь задать, Могу ли я получить другой вид, который находится за пределами моего запуска UITabBarController, без его включения в список элементов tabBarController?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
FacebookFeedViewController *facebookClass = [[FacebookFeedViewController alloc] initWithNibName:@"FacebookFeedViewController" bundle:nil];
TwitterFeedViewController *twitterClass = [[TwitterFeedViewController alloc] initWithNibName:@"TwitterFeedViewController" bundle:nil];
LinkedInFeedViewController *linkClass = [[LinkedInFeedViewController alloc] initWithNibName:@"LinkedInFeedViewController" bundle:nil];
FTLFullFeedViewController *masterClass = [[FTLFullFeedViewController alloc] initWithNibName:@"FTLFullFeedViewController" bundle:nil];
/// tab button title
facebookClass.title = @"Facebook";
twitterClass.title = @"Twitter";
[email protected]"LinkedIn";
[email protected]"FTL";
// tab button Images
facebookClass.tabBarItem.image = [UIImage imageNamed:@"facebook_32"];
twitterClass.tabBarItem.image = [UIImage imageNamed:@"twitter_32"];
WelcomeViewController *welcomeClass= [[WelcomeViewController alloc] initWithNibName:@"WelcomeViewController" bundle:nil];
navController = [[ UINavigationController alloc] initWithRootViewController:welcomeClass];
UINavigationController *navController2 = [[UINavigationController alloc] initWithRootViewController:facebookClass];
UINavigationController *navController3 = [[UINavigationController alloc] initWithRootViewController:twitterClass];
UINavigationController *navController4 = [[UINavigationController alloc] initWithRootViewController:linkClass];
UINavigationController *navController5 = [[UINavigationController alloc] initWithRootViewController:masterClass];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:navController,navController5,navController2,navController3,navController4,nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
Какую версию XCode вы используете? – Dan
Последняя версия, 4.6.2 – user2282749
Вы используете раскадровки? – Dan