2016-10-14 2 views
1

, 프로그래밍 방식으로 viewcontroller에서 전체 스토리 보드 (tabBarController)로 이동하고 싶습니다. 나는이 솔루션을 발견 :내 iOS 응용 프로그램에서 프로그래밍 방식으로 viewController에서 스토리 보드로 이동

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Home" bundle:nil]; 
    UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"SMShopViewController"]; 
    [self.navigationController pushViewController:controller animated:YES]; 

을하지만 내가

이 회신 내가 알고있는 것처럼

+1

어느 누구도 명확하지 않거나 이해하지 못했던 문제에 대해 정확히 무엇을하고 있는지, 무엇을했는지 묻습니다. –

+0

탭 표시 줄에 이미 연결된 세그먼트를 삽입 한 다음 다른 항목이 필요합니까? – vaibhav

답변

2

주셔서 감사합니다 내 tabBarController 직접 보여주고 싶은, 필요하지 않습니다, 당신은 UITabBarController 스토리 보드에있는 이 처럼 코드에서 보여 주시겠습니까?


그래서, 첫째로 당신은 부모 탐색 C가있는 경우 다음 코드

UITabBarController *tabBar = [self.storyboard instantiateViewControllerWithIdentifier:@"KITTabBarController"]; 
[self.navigationController pushViewController:tabBar animated:NO]; 

UITabBarController



에 대한 storyboard identifier을 설정 ontroller 더 좋은 방법은 다음과 같습니다.

[self.navigationController setViewControllers:@[tabBar] animated:YES]; 
관련 문제