0

I want to use AsyncImageView to load and image from a URL and then add this image to a UIView. I have retrieved my URL but when I try to use the method loadImageWithURL I can't because it is not declared in the interface for AsyncImageView but rather for AsyncImageLoader. Should I be using the interface AsyncImageLoader instead? Can anybody help me figure out how to modify my code to do this?

Link to image with code:

https://i.stack.imgur.com/wfv3o.jpg

- (void)viewDidLoad {

    CGRect frame = image.frame;
    AsyncImageView* asyncImage = [[AsyncImageView alloc] initWithFrame:frame];

    asyncImage.tag = 999;

    AppDelegate *thisDelegate = [[UIApplication sharedApplication] delegate];

    if (thisDelegate.isEchoesUser == YES) {
        url = [NSURL URLWithString:[[NSString stringWithFormat:@"%@%@", ECHOES_REST_SERVICE_THUMB3,
                                        [imageURL stringByReplacingOccurrencesOfString:ECHOES_REST_ADDRESS withString:@""]]
                                       stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]];
    }else if (thisDelegate.isEchoesUser == NO){
        url = [NSURL URLWithString:[[NSString stringWithFormat:@"%@%@", REST_SERVICE_THUMB3,
                                            [imageURL stringByReplacingOccurrencesOfString:REST_ADDRESS withString:@""]]
                                           stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]];
    }

    [asyncImage loadImageWithURL:url];

    [image addSubview:asyncImage];

    // Set the caption;
    [caption setText:captionText];

    [super viewDidLoad];

}

1 Answers1

0

Use a AsyncImageLoader instead, AsyncImageView doesn't have this function

Grzegorz Krukowski
  • 18,081
  • 5
  • 50
  • 71