나는 내 아이폰 OS 아이 패드 응용 프로그램에 다음과 같은 구조를 가지고 :실제 뷰 컨트롤러를 변경하는 올바른 방법은 무엇입니까? 로드 뷰의 부모에 제시하고 presentingViewController가 null 인
이- RootViewController :
- @property의의 UITabBar 로그인을 * 주 (성공 로그인 후로드되는) ;
appDelegate
에
나는 두 가지 속성이 있습니다 창 로그인. 첫 번째에는 UIWindow
을로드하고 다른 하나는 LoginViewController (UIViewController)
에로드합니다. 그리고 RootViewController로 로그인을 설정하십시오.
로그인했을 때 MainController
(확장 UITabbarController
)으로 입력 된 "main"이라는 속성이 있습니다.
은 성공적인 로그인 후 나는 메인로드 위의 코드를 사용
[_main setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[self presentViewController:_main animated:YES completion:nil];
MainController가있는 viewDidLoad 방법에로드되었다. 두 점 :
MainController의 대리인으로 설정해야합니까?
이것은 내 MainController의 viewDidLoad 방법의 시작이다 :
이[super viewDidLoad];
[self setDelegate:self];
NSLog(@"Parent view controller is: %@", [self parentViewController]);
NSLog(@"Presented view controller is: %@", [self presentedViewController]);
NSLog(@"Presenting view controller is: %@", [self presentingViewController]);
이의 로그는 다음과 같습니다
2013-01-20 21:23:53.180 MyApp[6304:11303] Parent view controller is: (null)
2013-01-20 21:23:53.181 MyApp[6304:11303] Presented view controller is: (null)
2013-01-20 21:23:53.182 MyApp[6304:11303] Presenting view controller is: (null)
나는의 ViewController를 제시하는 올바른 방법을 사용하고 있습니까? 또는 버튼을 클릭하거나 로그인 한 후보기를 표시 하시겠습니까? 누락 된 항목이 있습니까? 뷰 계층을 올바르게 사용하고 있습니까?
표시 할 컨트롤러를 포함하는 속성이 필요합니까?
지금부터 감사하겠습니다.
알렉스가있는 경우
또는, 내가 그들을 초기화. 그것들은 제대로로드되고 나타나기 때문에,''실행 중일 때 정의 된 parentViewController가 없습니다. –