Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.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 使用SDWebImage在服务器上更改映像时如何更新映像_Ios_Sdwebimage - Fatal编程技术网

Ios 使用SDWebImage在服务器上更改映像时如何更新映像

Ios 使用SDWebImage在服务器上更改映像时如何更新映像,ios,sdwebimage,Ios,Sdwebimage,我有图像的静态URL,但当我编辑该图像并返回主屏幕时,图像并没有改变,它仍然从缓存中获取旧图像 有什么方法可以更新缓存中的图像吗?在上,伙计们提供了一段代码来完成您需要的操作: [imageView sd_setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/olivier.poitrey/picture"] placeholderImage:[UIImage imageNamed:@"ava

我有图像的静态URL,但当我编辑该图像并返回主屏幕时,图像并没有改变,它仍然从缓存中获取旧图像

有什么方法可以更新缓存中的图像吗?

在上,伙计们提供了一段代码来完成您需要的操作:

[imageView sd_setImageWithURL:[NSURL URLWithString:@"https://graph.facebook.com/olivier.poitrey/picture"]
             placeholderImage:[UIImage imageNamed:@"avatar-placeholder.png"]
                      options:SDWebImageRefreshCached];

是的,我做了相同的操作,但仍然没有获得刷新图像。您手动更改了应用程序中的图片?是的,我正在更改应用程序中的图像并将其上载到服务器上。您如何从url获取图像?请向我展示[self.imgProfilePic sd_setImageWithURL:[nsurlwithstring:[nsstringwithformat:@“%@”,ServerPath,userObj.profilePicture]]占位符图像:[UIImage ImageName:@“profile_placeholder”]选项:SDWebImageRefreshCached];当您当时编辑图片时,请尝试清除缓存[[SDImageCache sharedImageCache]imageCache clearMemory];[[SDImageCache sharedImageCache]imageCache clearDisk];