NSData *imageData = nil; BOOL isExit = [[SDWebImageManager sharedManager] diskImageExistsForURL:[NSURL URLWithString:imageURL]]; if (isExit) { NSString *cacheImageKey = [[SDWebImageManager sharedManager] cacheKeyForURL:[NSURL URLWithString:imageURL]]; if (cacheImageKey.length) { NSString *cacheImagePath = [[SDImageCache sharedImageCache] defaultCachePathForKey:cacheImageKey]; if (cacheImagePath.length) { imageData = [NSData dataWithContentsOfFile:cacheImagePath]; } } } if (!imageData) { imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageURL]]; } return imageData;
ios 用sdwebimage怎么获取缓存的路径
最新推荐文章于 2023-03-30 15:00:40 发布