예 대단히 가능
문제 당신의 방법 당신은 "보기에"를 tabBarController를 추가을 갖는. 나는 당신의 충돌 버그를 복제 할 수 있었고 당신이 도움이되는 경고가 주어지지 않는다고 말했던 것처럼.
이 (내 예제는 AppDelegate에에 didFinishLaunching에)
잘못된 WAY하는
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
UIViewController *vc = [[UIViewController alloc] init];
[vc.view setFrame:self.window.frame];
UITabBarController *tabBarController = [[UITabBarController alloc] init];
NSMutableArray* controllers = [[NSMutableArray alloc] init];
for (int i=0; i<10; i++) {
UIViewController * vc1 = [[UIViewController alloc] init];
vc1.title = [NSString stringWithFormat:@"%d", i];
[controllers addObject:vc1];
}
[tabBarController setViewControllers:controllers];
self.window.rootViewController = vc;
[vc.view addSubview:tabBarController.view];
return YES;
올바른 방법은 윈도우 rootViewController로 tabBarController를 설정하는 것입니다 당신이 그 일을하는 방법입니다 tabBarControllers보기를 다른보기에 하위보기로 추가하는 것이 아닙니다.
합니다 (AppDelegate에에도 didFinishLaunching에서) 올바른 방법
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
UITabBarController *tabBarController = [[UITabBarController alloc] init];
NSMutableArray* controllers = [[NSMutableArray alloc] init];
for (int i=0; i<10; i++) {
UIViewController * vc1 = [[UIViewController alloc] init];
vc1.title = [NSString stringWithFormat:@"%d", i];
[controllers addObject:vc1];
}
[tabBarController setViewControllers:controllers];
self.window.rootViewController = tabBarController;
return YES;
희망이 바른 길에 당신을 설정합니다. 테이크 아웃 메시지는 viewController 뷰를 다른 viewController 뷰에 하위 뷰로 추가하지 말아야한다는 것입니다.
감사! 그것은 충돌을 해결합니다! 이제 내 견해는 모두 검은 색입니다 ... 나는 그것을 풀어 갈 것입니다! 감사합니다. –
기꺼이 도와 드리겠습니다. – anders