나는 (uiviewcontroller가 5 개인) uitabbarcontoller 및 uinavigation bar가있는 응용 프로그램에서 작업하고 있습니다. 나는 응용 프로그램에서이 모든 것을 만들었습니다하지만 난 그것을 실행하면 이것은 AppDelegate.m 클래스입니다appdelegate에서 uiviewcontoller 디스플레이를 만드는 방법
작동하지 않습니다
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UINavigationController *navCon = [[UINavigationController alloc] init];
UITabBarController *tabBarController = [[UITabBarController alloc] init];
self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
HomePageView *viewController = [[HomePageView alloc] init];
FeedViewController *feedViewController=[[FeedViewController alloc]init];
ProfileViewController *profileViewController=[[ProfileViewController alloc]init];
PlayViewController *playViewController = [[PlayViewController alloc]init];
ListeningSessionViewController *listeningSessionViewController= [[ListeningSessionViewController alloc]init];
RecievedViewController *recievedViewController =[[RecievedViewController alloc]init];
tabBarController.viewControllers=[NSArray arrayWithObjects:feedViewController,profileViewController,playViewController,listeningSessionViewController,recievedViewController, nil];
//navigating to the UITabBarController that you created
[navCon pushViewController:tabBarController animated:YES];
[navCon pushViewController:viewController animated:NO];
return YES;
}
왜 당신이 탐색 컨트롤러에 탭 바 컨트롤러를 추진하고있다? 각 탭에는 필요에 따라 자체 탐색 컨트롤러가 있어야합니다. – rmaddy
@rmaddy 해당 줄을 제거했지만 여전히 작동하지 않습니다. – ipalibowhyte
"작동하지 않습니다"라는 단어는 개발자가 사용할 수있는 가장 쓸모없는 단어입니다. 그것은 의미가 없다. 일어날 일에 대한 세부 정보로 질문을 업데이트하고 실제로 일어나고있는 것을 설명하십시오. 구체적으로 말하십시오. – rmaddy