如何在ios(情节提要)中刷新PageViewController

如何在ios(情节提要)中刷新PageViewController,ios,iphone,cocoa-touch,cocos2d-iphone,xcode6,Ios,Iphone,Cocoa Touch,Cocos2d Iphone,Xcode6,我在显示图像的应用程序中使用了PageViewController,如果任何用户想从PageViewController中删除特定图像,则用户可以将其删除,但我面临的问题是,当用户从PageViewController中删除图像后,已删除的图像显示了PageViewController的背面滚动图像时,任何人都可以帮助我解决此问题,即如何刷新PageController。我找到了一种解决方法,可以强制UIPageViewController忘记当前未显示的相邻页面的缓存视图控制器: pageVi

我在显示图像的应用程序中使用了
PageViewController
,如果任何用户想从
PageViewController
中删除特定图像,则用户可以将其删除,但我面临的问题是,当用户从
PageViewController
中删除图像后,已删除的图像显示了
PageViewController的背面
滚动图像时,任何人都可以帮助我解决此问题,即如何刷新PageController。

我找到了一种解决方法,可以强制UIPageViewController忘记当前未显示的相邻页面的缓存视图控制器:

pageViewController.dataSource = nil;
pageViewController.dataSource = self;
每次更改页面集时,我都会这样做。当然,这不会影响当前显示的页面


通过此解决方法,我避免了缓存错误,并且仍然可以在SetViewController:direction:animated:completion:中使用animated:YES。

删除图像时,它也会从包含图像的数组中删除?仍然会在pageViewController滚动视图的背面显示已删除的图像。删除图像时,它还从包含图像的数组中删除了?实际上,我希望当用户在PageViewController中看到图像时,比如相册,如果有四个图像,那么当用户看到这些图像时,他应该能够删除特定的图像,删除图像后,pageView控制器应该显示三个图像,所有的工作都完成了,但问题是,每当我删除一个图像时,它都会返回PageViewController滚动视图,所以现在当我滚动PageController时,它会在背面显示图像,同样的问题也很正常,如果我在删除一个图像后返回到上一个控制器,那么它工作正常,但是如果我在sameView上删除一个图像,然后开始滚动图像,那么问题就来了。数组的类型是什么?