Objective c 如何从DataViewController正确翻转UIPageViewController的页面?

Objective c 如何从DataViewController正确翻转UIPageViewController的页面?,objective-c,ios,ios5,uipageviewcontroller,Objective C,Ios,Ios5,Uipageviewcontroller,我希望能够由于特定页面上的事件而打开UIPageViewController。在Xcode中使用页面视图模板,实现这一点的正确方法是什么?我想让DataViewController和ModelController在RootViewController中包含对UIPageViewController的引用,然后使用[(UIPageViewController*)SetViewController]方法,但这似乎有些草率。有更好的方法吗?已经可以从DataViewController访问UIPage

我希望能够由于特定页面上的事件而打开UIPageViewController。在Xcode中使用页面视图模板,实现这一点的正确方法是什么?我想让DataViewController和ModelController在RootViewController中包含对UIPageViewController的引用,然后使用[(UIPageViewController*)SetViewController]方法,但这似乎有些草率。有更好的方法吗?

已经可以从DataViewController访问UIPageViewController。所有UIViewController子类都有一个名为“”的字段,该字段指向拥有它们的UIViewController子类(UIPageViewController使用的)

如果你想更改页面,只需拨打电话

[((UIPageViewController*)self.parentViewController) setViewControllers:
        target direction:UIPageViewControllerNavigationForward completion:nil];

太好了,现在知道了。不过仅供参考,我需要向dataviewcontroller添加一个引用modelviewcontroller的属性,以便获得下一个和上一个dataviewcontroller。我不确定是应该这样做,还是每个页面都有两个属性来引用下一页和上一页;省去了使用上一个和下一个视图初始化每个DataViewController的麻烦,而且它还消除了在页面上编辑模型时的任何顾虑(如果您说,删除下一个页面,您还必须记住更新该页面的所有引用)。@Marty您可以发布显示其功能的代码吗,完整的方法。