I am developing an application and I am using iOS5 storyboard. Basically what I have is a UITabBarController as the root controller which contains some UIViewController and a UISplitViewController. What I want to do is to use a UIPageViewController as the DetailController of the UISplitViewController. The problem is that the UIPageViewController doesn't show its view controllers but it shows a black screen. What I do is to initialize two content view controllers in the viewDidLoad method of the DetailController and assign them with the instruction:
[self setViewControllers:self.pagesViewControllerArray direction:UIPageViewControllerNavigationOrientationHorizontal animated:NO completion:nil];
so I cannot figure out where is the mistake.
The viewDidLoad method is the following:
- (void)viewDidLoad{
self.dataSource = self;
self.delegate = self;
self.page1ViewController = [[Page1ViewController alloc] initWithNibName:@"Page1ViewController" bundle:nil];
self.page2ViewController = [[Page2ViewController alloc] init];
self.pagesViewControllerArray = [NSArray arrayWithObjects:self.page1ViewController, self.page2ViewController, nil];
[self setViewControllers:self.pagesViewControllerArray direction:UIPageViewControllerNavigationOrientationHorizontal animated:NO completion:nil];
}
I tried to use both a viewcontroller with its nib associated and a viewcontroller with its view dynamically loaded but it is not working.
Any help would be really appreciated. Thanks