【发布时间】:2018-01-15 10:35:24
【问题描述】:
我正在尝试在侧边菜单 (MFSideMenu) 上更新我的个人资料图片,一旦我通过网络服务器更新个人资料图片,我想在我的 iOS 应用程序上进行设置。图片的网址相同,我无法升级它。我想问题是每次我更改图像时,都会从缓存中加载相同的图像 url,所以它不会改变。有没有什么方法可以在不需要更改 imageUrl 的情况下下载更改后的图像?
我总是得到回应
imageUrl :"user_image" = "profile/local/images/user_id/myimage";
因此,当我打开侧边菜单时,我会更新我的模型并从模型中获取信息。
`func menuAction(){
self.getUserDetails()
}
func getUserDetails() {
NotificationCenter.default.post(name: Notification.Name("NotificationIdentifier"), object: self)
self.menuContainerViewController.toggleLeftSideMenuCompletion(nil)
}`
【问题讨论】:
-
使用 NSNotificationCentre
-
我已经使用了 NSNotification center 但它仍然没有改变图像
-
图片在网络服务器上更新了吗?
-
是的,图像已在网络服务器上更新,但即使在触发通知后也不会在侧边菜单上更新。
-
请分享通知功能的代码。
标签: ios swift afnetworking sdwebimage image-caching