I have encountered this problem where the device has not enough space to save a video file which is present in the NSDocumentsDirectory, to the photo library.
The problem is, UISaveVideoAtPathToSavedPhotosAlbum does not throw any error while saving it.
UISaveVideoAtPathToSavedPhotosAlbum(session.outputURL.path, self, @selector (video:didFinishSavingWithError:contextInfo:), nil); //session is AVAssetExportSession
- (void)video:(NSString *)videoPath didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
[MBProgressHUD hideHUDForView:self.view animated:YES];
if(error) //else part is executed every time...
{
ALERT_WITH_MESSAGE([@"Your composition could not be saved to your device library. Error: " stringByAppendingString:error.description]);
}
else
{
ALERT_WITH_MESSAGE(@"Your composition has been saved to your device library.");
}
}