Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone ios 5.1中的UIPageViewController_Iphone_Ios5.1_Uipageviewcontroller - Fatal编程技术网

Iphone ios 5.1中的UIPageViewController

Iphone ios 5.1中的UIPageViewController,iphone,ios5.1,uipageviewcontroller,Iphone,Ios5.1,Uipageviewcontroller,我正在使用UIPageViewController显示两个视图控制器。我希望此视图控制器显示在不同的页面中,在刷卡时,页面应被翻转。当我在iPad simulator 6.0中运行它时,它工作正常,但当我在iPad simulator 5.1中运行它时,两个视图控制器都显示在同一页面上。这是密码 NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithInteger:UIPageViewCon

我正在使用
UIPageViewController
显示两个视图控制器。我希望此视图控制器显示在不同的页面中,
在刷卡时,页面应被翻转。当我在iPad simulator 6.0中运行它时,它工作正常,但当我在iPad simulator 5.1中运行它时,两个视图控制器都显示在同一页面上。这是密码

NSDictionary *options =  [NSDictionary dictionaryWithObject:[NSNumber numberWithInteger:UIPageViewControllerSpineLocationMid] forKey:UIPageViewControllerOptionSpineLocationKey];

self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl
                                                              navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:options];

    //Step 2:
    //Assign the delegate and datasource as self.
    self.pageViewController.delegate = self;
    self.pageViewController.dataSource = self;

    //Step 3:
    //Set the initial view controllers.
    GameSelectViewController *gameViewController = [[GameSelectViewController alloc] initWithNibName:@"GameSelectViewController" bundle:nil];

    HighscoreViewController *highScoreViewController = [[HighscoreViewController alloc] initWithNibName:@"HighscoreViewController" bundle:nil];

    viewControllers = [NSArray arrayWithObjects:highScoreViewController,gameViewController, nil];

    [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];

    //Step 4:
    //ViewController containment steps
    //Add the pageViewController as the childViewController
    [self addChildViewController:self.pageViewController];

    //Add the view of the pageViewController to the current view
    [self.view addSubview:self.pageViewController.view];

    //Call didMoveToParentViewController: of the childViewController, the UIPageViewController instance in our case.
    [self.pageViewController didMoveToParentViewController:self];

    //Step 5:
    // set the pageViewController's frame as an inset rect.
    self.pageViewController.view.frame = self.view.frame;
我是iPhone开发的新手。请做必要的事。谢谢