これが私が試したコードスニペットです:
[library writeImageToSavedPhotosAlbum:self.checkInImage.CGImage metadata:self.metadata
completionBlock :^(NSURL * assetURL, NSError * error) {
NSLog (@"Asset url = %@", assetURL);
NSError *err;
NSString *docDir = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *jpgFilePath = [NSString stringWithFormat:@"%@/test.jpg", docDir];
NSFileManager *fileManager = [NSFileManager defaultManager];
[fileManager moveItemAtURL:assetURL toURL:[NSURL URLWithString:jpgFilePath] error:&err];
NSLog(@"error is %@", err);
}];
Error Domain=NSCocoaErrorDomain Code=262 "The operation could not be completed. (Cocoa error 262.)" UserInfo=0xb49a680 {NSURL=assets-library://asset/asset.JPG?id=6FAC823A- というエラーが表示されます。 33CB-489B-A125-714FBA5F0EE8&ext=JPG}
何か案は?