- (void)loadThumbnailImage:(void (^)())completionBlock { dispatch_queue_t fetchQ = dispatch_queue_create("ConfigureCell", NULL); dispatch_async(fetchQ, ^{ NSURL *address = [NSURL URLWithString:self.smallPictureURl]; UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:address]]; dispatch_async(dispatch_get_main_queue(), ^{ self.thumbnailImage = image; completionBlock(); }); }); }
Develop
2014.11.21 14:41
[ios] 비동기 블럭 코드 예제
조회 수 906 추천 수 0 댓글 0