Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/115.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
Ios 在UIPageViewController内更新UIImageView图像_Ios_Uipageviewcontroller - Fatal编程技术网

Ios 在UIPageViewController内更新UIImageView图像

Ios 在UIPageViewController内更新UIImageView图像,ios,uipageviewcontroller,Ios,Uipageviewcontroller,我有一个pageViewController,每个视图控制器页面上都有uiImageViews。图像是异步下载的。在任何翻页发生之前,我更新第一页都没有问题,但是一旦翻页打开pageviewcontroller,当前打开的页面在图像更改时不会更新。如何使当前视图控制器更新其视图 -(void) updateImage:(UIImage *) image{ MyCustomPage * dataViewController = [self.viewControllers lastObject]

我有一个pageViewController,每个视图控制器页面上都有uiImageViews。图像是异步下载的。在任何翻页发生之前,我更新第一页都没有问题,但是一旦翻页打开pageviewcontroller,当前打开的页面在图像更改时不会更新。如何使当前视图控制器更新其视图

-(void) updateImage:(UIImage *) image{
  MyCustomPage * dataViewController = [self.viewControllers lastObject];
  dataViewController.myImageView.image = image;
}
这就是我需要的:

MyCustomPage * currentViewController = [self viewControllerAtIndex:currentPageNum];
NSArray *viewControllers = @[currentViewController];
[self.pageViewCntrl setViewControllers:viewControllers
               direction:UIPageViewControllerNavigationDirectionForward
                animated:NO
              completion:nil];

你的问题需要2000万美元才能回答。是的,经过长时间的努力,我发布了这个问题,但很快就找到了解决办法。