0
iPad 용 전자 서적 작업 중입니다. 책의 모든 페이지는 인터페이스 스토어 빌더에서 페이지 번호가 식별자로 설정된 StoryBoard의보기 컨트롤러입니다. Navigation을 구현하는 클래스에서 작업하고 있는데, View Controller를 표시하고 해제하는 역할을 담당합니다. 제시된 뷰 컨트롤러에 버튼 집합을 중첩하고 IBActions를 처리함으로써 그렇게합니다.UIViewControllers를 탐색하는 최적의 방법
내 문제는 일부 viewcontroller (짝수 페이지)가 제공되지 않는다는 것입니다. 왜 누군가는 볼 수 있습니까?
@implementation Navigator
UIViewController *currentPageVC;
UIViewController *nextPageVC;
int currentPage = 0;
-(void)viewDidLoad{
[self getLandingPage];
}
-(void)getLandingPage{
currentPageVC = [self.storyboard instantiateViewControllerWithIdentifier:@"Landing"];
currentPage = 0;
NSLog(@"Trying to present landing page");
}
-(IBAction)goToNextPage{
[currentPageVC dismissModalViewControllerAnimated:YES];
currentPage++;
nextPageVC = [self.storyboard instantiateViewControllerWithIdentifier:[NSString stringWithFormat:@"%d", currentPage ]];
[self presentModalViewController:nextPageVC animated:YES];
[nextPageVC.view addSubview:self.view];
currentPageVC = nextPageVC;
NSLog(@"Current Page is %d", currentPage);
}