saving the videos and photos in iPhone Simultor 4.0

Posted by Mohammed Sadiq on Stack Overflow See other posts from Stack Overflow or by Mohammed Sadiq
Published on 2010-05-06T11:12:37Z Indexed on 2010/05/06 11:18 UTC
Read the original article Hit count: 453

Filed under:

Hi All,

From 4.0 apple has extended their api support to access the videos and photos from the phone. I am using only iPhone 4.0 simulator to test my application. When I try to save the video as apple has mentioned in their api docs, its giving the error something like "Error Saving the Asset". The way I try to store the video is as follows :

ALAssetsLibraryWriteVideoCompletionBlock _videoCompblock = ^(NSURL *assetURL, NSError *error){
    if(assetURL)
    {
        NSLog(@"Video AssetUrl : %@", [assetURL absoluteString]);
    }
    else if(error)
    {
        NSLog(@"The Error occured : %@", [error localizedDescription]);
    }

};

BOOL isSupported = [library deoAtPathIsCompatibleWithSavedPhotosAlbum:videoFileUrl];

if(isSupported)
{
    [library writeVideoAtPathToSavedPhotosAlbum:videoFileUrl completionBlock:_videoCompblock];
}

The above methods should print the url of the video on successful saving of the video file. But its printing the error message as "ERROR SAVING THE ASSET".

Any idea or help on this topic will be greatly appreciated.

Best Regards,

Mohammed Sadiq.

© Stack Overflow or respective owner

Related posts about iphone