아이폰어플개발정보2010. 6. 24. 11:39
HTTP 서버에서 이미지를 다운로드 하는 방법

by alex 28. 4월 2009 13:28


//Download image from HTTP server

NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com/intl/en_ALL/images/logo.gif"]];

UIImage *image = [UIImage imageWithData:imageData];



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

댓글을 달아 주세요

아이폰어플개발정보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 오늘마감

댓글을 달아 주세요

아이폰어플개발정보2010. 6. 24. 11:37
이미지를 이미지 라이브러리에 저장하는 방법

by alex 12. 5월 2009 15:28


-(void)savePictureToLibrary{   

    UIImage *img = [[UIImage imageNamed:@"image.png"];

    UIImageWriteToSavedPhotosAlbum(img, self, @selector(image:didFinishSavingWithError:contextInfo:), self);

}

 
 
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{

    NSString *str = @"Saved!!!";

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Saved." message:str delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];

    [alert show];

}



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

댓글을 달아 주세요