Question

I'm trying to save a video made in an app to a custom album. I've tried the solution proposed on Saving Video in an Album Created, however, these blocks are executed asynchronously resulting in my asset in the result block being nil.

I've succeeded in creating the album, writing a video to it doesn't seem to work with the above methods. I have no clue what's going on. Can someone give me a heads up on this?

Was it helpful?

Solution

The url you got is a file url but not an ALAsset url.

You'll need to save that mov to camera roll first and add its asset reference to the custom album.

Check out the example code in this tutorial.

http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/

OTHER TIPS

for video saving support, just add the function below to the category offered here: http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/

 -(void)saveVideoLocalUrl:(NSURL*)assetURL toAlbum:(NSString*)albumName withCompletionBlock:(SaveImageCompletion)completionBlock
 {
    //add the asset to the custom photo album
    [self writeVideoAtPathToSavedPhotosAlbum:assetURL completionBlock:^(NSURL *assetURL, NSError *error)    {
       NSLog(@"error: %@", [error description]);

       [self addAssetURL: assetURL
              toAlbum:albumName
       withCompletionBlock:completionBlock];
    }];
 }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top