nicklockwood / AsyncImageView

[DEPRECATED]
http://charcoaldesign.co.uk/source/cocoa#asyncimageview
Other
906 stars 186 forks source link

Image not loading, what had i done wrong ? #20

Closed kohdesmond closed 12 years ago

kohdesmond commented 12 years ago

Hi Nick,

will you be able to tell me when had i gone wrong ?

the image is not showing, not event the UIIndicator

nicklockwood commented 12 years ago

You are copying the image property of the AsyncImageView into another view after setting it to load. That won't work because the image won't have loaded yet so the image will be nil.

Why not just make self.largeImgView into an AsyncImageView and load the image URL directly on that view?

kohdesmond commented 12 years ago

thanks nick,

UIImageView selectorView = [[AsyncImageView alloc] initWithFrame:CGRectMake(0, 105, 250, 250.0f)]; selectorView.contentMode = UIViewContentModeScaleAspectFit; selectorView.backgroundColor = [UIColor clearColor]; [[AsyncImageLoader sharedLoader] cancelLoadingImagesForTarget:selectorView]; ((AsyncImageView )selectorView).imageURL = [self.picsArray objectAtIndex:self.carouselView.currentItemIndex];

//UIImageView *imgView = selectorView;

self.largeImgView=selectorView;

[self.largeImageView addSubview:self.largeImgView];
imageLocation=CGRectMake(selectorView.frame.origin.x, selectorView.frame.origin.y, selectorView.frame.size.width, selectorView.frame.size.height);
self.largeImageView.hidden=YES;