I'm using below code to save a video to photo library.
NSString *ss = [finalVideoURL path];
__block PHObjectPlaceholder *placeholder;
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetChangeRequest* createAssetRequest = [PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:[NSURL fileURLWithPath:ss]];
_placeholder = [createAssetRequest placeholderForCreatedAsset];
} completionHandler:^(BOOL success, NSError *error) {
if (success)
{
NSLog(@" success iOS 9");
}
else
{
NSLog(@"%@", error);
}
}];
This code works well with iOS 8.x.
But it fails with error code -1 in iOS 9.x
.
The error is
`Error Domain=NSCocoaErrorDomain Code=-1 "(null)"`
Any idea about this behavior in iOS 9.? Any help is appreciated ! Thanks