가능한 중복 :
Download image asynchronously어떻게 여러 개의 이미지를 다운로드하는 asyncronously
내가 비동기 적으로 여러 이미지를 다운로드하고 싶습니다. 나는 10 개 이미지의 배열을하고 난 10 uiimageview
, 나는이 같은 일을 오전에 이러한 이미지를 보여주고 싶어하지만, 그것은 단지 하나 개의 이미지
- (void)loadImage {
NSData* imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:[myarray objectatindex:0]]];
UIImage* image = [[[UIImage alloc] initWithData:imageData] autorelease];
[imageData release];
[self performSelectorOnMainThread:@selector(displayImage:) withObject:image waitUntilDone:NO];
}
The final method we need to create takes in the image to display and sets it on our image view.
- (void)displayImage:(UIImage *)image {
[imageView setImage:image]; //UIImageView
}
을 보여
그래서 친절하게 내가 10을 만들지 않고 다른 여러 이미지를 표시하는 방법을 말해 다른 방법.
네, SDWebImage를 사용할 수있는 가장 좋은 방법이 될 수 있습니다. https://github.com/rs/SDWebImage – mohacs
어떻게 사용합니까? –
@Adnan 어느 것을 사용해야합니까? –