No visible @interface for UIImageView declares sd_setShowActivityIndicatorView selector and sd_setIndicatorStyle not detected

It is very strange that it sd_setImageWithURLworks, but got an error in sd_setShowActivityIndicatorView:YESand sd_setIndicatorStyle.

Below what I have done.

[cell.cellImgView sd_setShowActivityIndicatorView:YES];
[cell.cellImgView sd_setIndicatorStyle:UIActivityIndicatorViewStyleGray];

[cell.cellImgView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://img.youtube.com/vi/%@/hqdefault.jpg",[[[galleryDic objectForKey:@"data"] valueForKey:@"Video_id"] objectAtIndex:indexPath.row]]] placeholderImage:[UIImage imageNamed:@"youtube-video"] ];

Please see the image below: enter image description here

+6
source share
5 answers

I get it now. Well, I need to import #import "UIView+WebCache.h"along with others, after which I used the following:

[cell.cellImgView sd_setShowActivityIndicatorView:YES];
[cell.cellImgView sd_setShowActivityIndicatorView:UIActivityIndicatorViewStyleGray];

In addition, I deleted the SDWebImage folder that I used for manual integration, then I installed it again through the POD, and now it works the way I wanted.

+10
source

I am transitioning to version 4.0.

and

#import <SDWebImage/UIView+WebCache.h>
+6

There is no such method, as sd_setShowActivityIndicatorViewand sd_setIndicatorStylein SDWebImage> UIImageView+WebCache.h, so he does not see visible for @interface UIImageViewannounces selector sd_setShowActivityIndicatorViewand sd_setIndicatorStyleis not detected

Use the following instead.

 [cell.cellImgView setShowActivityIndicatorView:YES]; 
 [cell.cellImgView setIndicatorStyle:UIActivityIndicatorViewStyleGray];

These methods are in UIImageView+WebCache.h

/**
 *  Show activity UIActivityIndicatorView
 */
- (void)setShowActivityIndicatorView:(BOOL)show;

/**
 *  set desired UIActivityIndicatorViewStyle
 *
 *  @param style The style of the UIActivityIndicatorView
 */
- (void)setIndicatorStyle:(UIActivityIndicatorViewStyle)style;
+2
source

Import next file

#import "UIImageView+WebCache.h"

#import "UIImageView+UIActivityIndicatorForSDWebImage.h"
+1
source

For those who have this problem in 2019

sd_setShowActivityIndicatorView was deleted in SDWebImage v5

Use this instead

imageView1.sd_imageIndicator = SDWebImageActivityIndicator.gray
//or
imageView2.sd_imageIndicator = SDWebImageProgressIndicator.'default'
//or
imageView2.sd_imageIndicator = SDWebImageActivityIndicator.medium //large, small, gray ...
+1
source

Source: https://habr.com/ru/post/1678322/


All Articles