죽어도  다시한번

웹 URL의 이미지 파일을 UIImage 객체로 담고자 할 때 코드이다.

// 이미지 URL 정보
NSURL *url = [NSURL URLWithString:@"http://domain/imageFileName.jpg"];
// 이미지 URL 정보로 데이터를 받아온다.
NSData *data = [NSData dataWithContentsOfURL:url];
// 이미지 데이터를 UIImage 객체에 담는다.
UIImage *image = [[UIImage alloc] initWithData:data];