保存された画像の名前をカメラから取得する方法を検索しましたが、簡単なものが見つかりませんでした。
これは私のコードです:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
if( [picker sourceType] == UIImagePickerControllerSourceTypeCamera){
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
[library writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)image.imageOrientation completionBlock:^(NSURL *assetURL, NSError *error )
{
NSLog(@"IMAGE SAVED TO PHOTO ALBUM");
[library assetForURL:assetURL resultBlock:^(ALAsset *asset )
{
NSLog(@"we have our ALAsset!");
NSLog(@"%@", assetURL);
}
failureBlock:^(NSError *error )
{
NSLog(@"Error loading asset");
}];
}];
}
}
私はあなたが答えを持っている、私はそれをテストさせていただきます.
前もって感謝します。