1
유휴 시간에 서버에서로드 된 이미지를 저장하려고합니다. 다음을 사용하여 iPhone 메모리에 이미지를 저장합니다. iPhone 유휴 시간에 이미지 저장
- (void)saveImage:(UIImage *)image withName:(NSString *)name
{
NSData *data1 = UIImageJPEGRepresentation(image, 1.0);
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:name];
[fileManager createFileAtPath:fullPath contents:data1 attributes:nil];
if (image==nil) {
NSLog(@"Not Saved...:%@",name);
}
}
그러나 그의 방법은 내가 시간을 정지 가지고 호출 할 때 .... 그게 ... 난 아이폰이 비활성 상태 일 때 이미지를 저장할 ..... 도움이 될 수 있습니다 싶지 않아?
감사합니다.
안녕하세요, iOS 4 .....하지만 사용하고 있습니다. 코드에 오류가 있습니다 ... 문법적으로 맞습니까? – Rony
와우, 잊어 버린 {... – jtbandes
나는 그렇게 생각한다 .... 감사합니다 :) – Rony