ImageDownload


1
2
3
4
5
6
7
8
9
10
11
12
13
14
dispatch_queue_t imageQueue = dispatch_queue_create("imageDownloader"nil);
        dispatch_async(imageQueue, ^{
            //download image
            NSURL *imageUrl = [NSURL URLWithString:[[_masterListArray objectAtIndex:i] objectForKey:@"productImageUrl"]];
            
            
            NSData *imageData = [NSData dataWithContentsOfURL:imageUrl];
            UIImage *image = [UIImage imageWithData:imageData];
             dispatch_async(dispatch_get_main_queue(), ^{
                //[button setImage:image forState:UIControlStateNormal];
                 [row.iv_product initWithImage:image];
                 
            });
        });
cs


'Developer > iOS - Objective-C' 카테고리의 다른 글

Lottie (Objctive-C)  (0) 2019.07.23
Protocol  (0) 2017.12.29
ImageDownload  (0) 2017.03.21
CustomView (UIView)  (0) 2017.03.21
NavigationController 내 TabbarController 자식의 부모 컴포넌트 사용  (0) 2017.01.09
viewController 에서 NavigationController 쓰기  (0) 2016.11.21

이 글을 공유하기


댓글(0)

Designed by CMSFactory.NET