我正在尝试实现 UIPageViewController 及其工作,但索引始终为 cero。我实施:
-(UIViewController*)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
{
NSUInteger index=[self indexOfViewController:(contentViewController*)viewController];
NSLog(@" index %d", index);
if (index==NSNotFound) {
return nil;
}
index++;
return [self viewControllerAtIndex:index];
}
但视图控制器的索引从未更新。为什么有任何指示?