【发布时间】:2013-10-09 09:26:07
【问题描述】:
我正在尝试在轮换期间更新UIPageViewController 中的当前页面,如下所示:
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
NSArray *controllers = @[someViewController];
UIPageViewControllerNavigationDirection direction = UIPageViewControllerNavigationDirectionForward;
[self.pageController setViewControllers:controllers direction:direction animated:YES completion:^(BOOL finished) {
/// This completion block isn't called ever in this case.
}];
}
但是,由于某种原因,在这种情况下永远不会调用完成块,而当我从其他地方调用具有相同参数的相同方法时,它会按预期调用。
谁能确认这种奇怪的行为,如果这是UIPageViewController 中的一个错误,还是只是对我的滥用?
更新
我发现如果我将参数animated 更改为NO 将按预期调用完成块!所以,在我看来,这是UIPageViewController 的一个错误。
【问题讨论】:
-
在我的情况下,当我尝试设置我在 self.pageViewController.viewControllers.firstObject 中已有的相同控制器时遇到了问题
标签: ios objective-c uipageviewcontroller screen-rotation