iPad 앱에서 UISplitViewController에 문제가 발생했습니다. UISplitView 내부의 UINavigationController를 사용하여 간단한 탐색 트리를 만들려고합니다. 나는이해야 할 다음과 같은 기본 코드를 사용했습니다 :이 코드는 성공적으로 탐색 컨트롤러에보기를 밀어UISplitViewController가 UINavigationController를 사용하려고 시도한 후 자동 회전을 중지합니다.
#import "NavController.h"
@implementation NavController
@synthesize navigationController;
- (void) awakeFromNib {
UIViewController *testController = [[UIViewController alloc] init];
UITableView *tableView = [[UITableView alloc] init];
[testController setView: tableView];
[navigationController pushViewController: testViewController
animated: YES];
}
@end
NavController.h
@interface NavController : NSObject {
/*
* This is connected properly to the UINavigationController in the
* UISplitViewController through Interface Builder.
*/
UINavigationController *navigationController;
}
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
@end
NavController.m을, 나는 탐색 할 수 있습니다 다시 버튼을 사용하여, 그러나, 내 문제는 사실이 일어난 후 내 UISplitViewController 더 이상 자동 회전 또는 세로 위치에서 전혀 회전 함께 발생합니다. 이 코드를 제거하면 뷰가 푸시되지 않습니다. 예상대로 작동합니다.
내가 잘못하고있는 것이 무엇인가? 나는 이것을 올바른 방향으로 가고 있습니까?
도움 주셔서 감사합니다.
흥미 롭습니다. UINavigationController를 자동으로 회전하도록 설정하는 방법에 대해서는 생각해 본 적이 없습니다. 나는 이것을 도전적으로 시도 할 것이다. UISplitView를 사용하는 것이 더 이해하기를 바랍니다. 답변 해 주셔서 감사합니다! –
오늘 밤이 기회를 놓치지 마십시오. 내 UINavigationController 하위 클래스 및 자동 회전을 사용하려면 필요한 메서드를 추가했습니다. 이제 완벽하게 작동합니다! 지금까지 수동 회전보기를 수행 할 필요가 없었습니다. 당신의 솔루션에 대해 대단히 감사합니다! –
그게 좋습니다! 나는 아직도 그것이 왜 효과가 있는지는 잘 모르지만 나는 그것이 기쁘다. :) – donkim