프로그래밍/iOS
더 빠르게 HTTP 서버에서 이미지 다운로드하는 방법
백룡화검
2011. 5. 21. 20:29
// [NSData dataWithContentsOfURL:[NSURL URLWithString:@"https://t1.daumcdn.net/cfile/tistory/16647B174B82CA3508"]];
// 위 방법 보다 아래의 방법이 더 빠름!
NSMutableURLRequest *requestWithBodyParams = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://t1.daumcdn.net/cfile/tistory/16647B174B82CA3508"]];
NSData *imageData = [NSURLConnection sendSynchronousRequest:requestWithBodyParams returningResponse:nil error:nil];
UIImage *image = [UIImage imageWithData:imageData];
출처 : http://lambert.tistory.com/283