아이폰어플개발정보2010. 6. 24. 11:38
아이폰 어플 개발, 원격 HTTP에서 이미지를 빠르게 저장하는 방법

by alex 9. 5월 2009 03:41
//This method works much faster then [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com/intl/en_ALL/images/logo.gif"]];

//Also it works better on bad internet connections

NSMutableURLRequest *requestWithBodyParams = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com/intl/en_ALL/images/logo.gif"]];

NSData *imageData = [NSURLConnection sendSynchronousRequest:requestWithBodyParams returningResponse:nil error:nil];

UIImage *image = [UIImage imageWithData:imageData];



출처 : http://blog.naver.com/PostView.nhn?blogId=amoros21&logNo=140107111261
Posted by 오늘마감

댓글을 달아 주세요