sdwebimage

SDWebImage Set Image To UIButton in CellView Using Swift

删除回忆录丶 提交于 2019-12-02 15:21:45
问题 Hi I am using SDWebImage to set image to a button in xcode 10.2.1. I am trying the following import SDWebImage cell.bProfileImage.sd_setImage(with:URL(string: individualChatsListArray[indexPath.row].profile_image), forState:.normal) But I am getting the following error Value of optional type 'UIButton?' must be unwrapped to refer to member 'sd_setImage' of wrapped base type 'UIButton' In the nib file the items are linked and declared as per below @IBOutlet weak var bProfileImage: UIButton!

SDWebImage repeating images in cell instead of waiting to load.

大憨熊 提交于 2019-12-02 11:02:46
问题 I am using SDWebImage for fetching images from server to my table view app in IOS. But the problem is that when I scroll down in table view instead of waiting for the images to load it put the images downloaded in the first few rows of table view and repeat those images till the end row and when it downloads the images it changes those repeated images to the actual image for that row. NSURL * url = [NSURL URLWithString:string]; SDWebImageManager *manager = [SDWebImageManager sharedManager];

iOS: SDWebImageManager not caching image

十年热恋 提交于 2019-12-02 07:20:50
问题 I'm creating a slideshow using UIImageView , and the image links are in an array , so while I was at it, I learned that SDWebImageManager lets hit the URLs once only and then it caches the images for later use. But what I'm monitoring in my app is that the 1st image is cached, I believe, but the 2nd image URL is always being hit. Here's my code: - (void)viewDidLoad { [super viewDidLoad]; arry = [[NSMutableArray alloc] init]; [arry addObject:@"http://adjingo.2cimple.com/content/151/Image/6291

SDWebImage repeating images in cell instead of waiting to load.

£可爱£侵袭症+ 提交于 2019-12-02 05:58:12
I am using SDWebImage for fetching images from server to my table view app in IOS. But the problem is that when I scroll down in table view instead of waiting for the images to load it put the images downloaded in the first few rows of table view and repeat those images till the end row and when it downloads the images it changes those repeated images to the actual image for that row. NSURL * url = [NSURL URLWithString:string]; SDWebImageManager *manager = [SDWebImageManager sharedManager]; [manager downloadImageWithURL:url options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize) {

iOS: SDWebImageManager not caching image

Deadly 提交于 2019-12-02 05:45:41
I'm creating a slideshow using UIImageView , and the image links are in an array , so while I was at it, I learned that SDWebImageManager lets hit the URLs once only and then it caches the images for later use. But what I'm monitoring in my app is that the 1st image is cached, I believe, but the 2nd image URL is always being hit. Here's my code: - (void)viewDidLoad { [super viewDidLoad]; arry = [[NSMutableArray alloc] init]; [arry addObject:@"http://adjingo.2cimple.com/content/151/Image/6291.jpg"]; [arry addObject:@"http://adjingo.2cimple.com/content/151/Image/6290.jpg"]; NSURL *imageURL =

SDWebImage之RunLoop

↘锁芯ラ 提交于 2019-12-01 18:53:59
在SDWebImage中的SDWebImageDownloaderOperation的start函数中,调用了CFRunLoopRun(),我们来看一下CFRunLoopRun到底是做什么的,起到了什么作用。 每一个线程有一个runloop,既不可以创建,也不能销毁线程的runloop。Core Foundation根据需求为你创建,通过 CFRunLoopGetMain 可以获得当前线程的runloop。调用CFRunLoopRun可以使当前线程的runloop以默认模式运行起来,直到调用 CFRunLoopStop 来停止runloop。你也可以调用 CFRunLoopRunInMode 来使当前线程的runloop以指定模式运行起来一段时间或者直到runloop被停止。【runloop只能在请求模式至少有一个source或者timer可监控的情况下运行起来。】 一般主线程会自动运行runloop,我们一般情况下不会去管。在其他子线程中,如果需要我们需要去管理。使用runloop后,可以把线程想象成进入了一个循环;如果没有这个循环,子线程完成任务后,这个线程就结束了。所以如果需要一个线程处理各种事件而不让它结束,就需要运行runloop。 在SDWebImageDownloaderOperation中, 1234567891011 - (void)start{ ... self

Is there a framework for image caching on iOs?

六眼飞鱼酱① 提交于 2019-12-01 11:19:53
I'm already using AFNetworking for async image download. I was wondering if there's a way for storing on disk or Core Data, should I investigate SDWebImage for that? Or you would suggest to have a custom solution. Basically I would like to have a very transparent way to get images from a url, so first look for them in a NSCache, if not found look on disk (or Core Data)l if not found again download async. Thanks for any idea SDWebImage has proven to be a really solid implementation of async image fetching and caching. If you're using your web images for buttons or imageviews you can even call

UICollectionView + SDWebImage + Cell reuse

馋奶兔 提交于 2019-11-30 22:13:43
I have a UICollectionView with a custom UICollectionViewCell class which adds another UIView (thumbnailView) to its contentView. This other view has a UIImageView property (imageView) whose image gets loaded with SDWebImage asynchronously. This all works fine until the cell is reused while the image of the original cell is still being loaded. If you scroll fast enough through the CollectionView images start to pop up in cells where they are not supposed to be (probably because the cell got reused and the image download finishes afterwards), just to get replaced as soon as the correct image for

UICollectionView + SDWebImage + Cell reuse

青春壹個敷衍的年華 提交于 2019-11-30 17:40:15
问题 I have a UICollectionView with a custom UICollectionViewCell class which adds another UIView (thumbnailView) to its contentView. This other view has a UIImageView property (imageView) whose image gets loaded with SDWebImage asynchronously. This all works fine until the cell is reused while the image of the original cell is still being loaded. If you scroll fast enough through the CollectionView images start to pop up in cells where they are not supposed to be (probably because the cell got

Build fail when using SDWebImage

时光怂恿深爱的人放手 提交于 2019-11-30 17:33:44
I am trying to use the classes of SDWebImage in my project. I've added the classes to my project and when I try to build it I get 7 errors: Undefined symbols for architecture i386: "_OBJC_CLASS_$_MKAnnotationView", referenced from: l_OBJC_$_CATEGORY_MKAnnotationView_$_WebCache in MKAnnotationView+WebCache.o "_CGImageSourceCreateIncremental", referenced from: -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o "_CGImageSourceUpdateData", referenced from: -[SDWebImageDownloader connection:didReceiveData:] in SDWebImageDownloader.o "_CGImageSourceCopyPropertiesAtIndex",