TabController에서 TabController에 2 개의 ViewController가 있습니다. TabBarController에서 TabControl과 TabBarController로 이동해야합니다. 내 TwoViewController에서TabBarController에서 ViewController로 끝내기
//AppDelegate.m
UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:_viewController];
self.window.rootViewController = nav;
//ViewController.m
tab=[[UITabBarController alloc]init];
tab.delegate=self;
oneViewController=[[OneViewController alloc]init];
UINavigationController *oneNav=[[UINavigationController alloc]initWithRootViewController:oneViewController];
[email protected]"One";
twoViewController=[[TwoViewController alloc]init];
UINavigationController *twoNav=[[UINavigationController alloc]initWithRootViewController:twoViewController];
[email protected]"Two";
views=[[NSMutableArray alloc]initWithObjects:oneNav, twoNav, nil];
tab.viewControllers=views;
[tab.view setFrame:CGRectMake(0, 0, 1024, 748)];
[self.view addSubview:tab.view];
(탭 2) 나는 그 나는 다음과 같은 코드를 작성했습니다위한 버튼, ThanksViewController에 저를 취해야 클릭에있는 'OK'를했습니다 :
아래에있는 내 코드를 확인하시기 바랍니다 :
//TwoViewController.m
-(void)OK
{
ThanksViewController *thanksViewController=[[ThanksViewController alloc]init];
[self.navigationController pushViewController:thanksViewController animated:YES];
}
내 문제는 내가 TabBarController 종료하고 (하단에 TabBarController없이) ThanksViewController로 이동하지만,이 경우에 나는 TwoViewController 대신에 TabBarController 자체에 ThanksViewController을 얻고있다 할 것입니다.
누군가이 사례에 대해 제게 제안 해 주시겠습니까? 미리 감사드립니다.
가능한 중복 [버튼 클릭에 UINavigationController가에 UITabBarController가 종료하는 방법 (http://stackoverflow.com/questions/18332647/how-to-exit- from-uitavbarcontroller-to-uinavigationcontroller-on-button-click) – rckoenes
그건 내 게시물 이었지만 적절한 응답을 얻을 수 없어서이 게시물에서 더 명확하게 생각했습니다. – maddy