我正在使用以下代码将视频保存到照片库。
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);
}
}];
此代码适用于iOS 8.x.
但它失败,错误代码为 -1 in iOS 9.x
。错误是
`Error Domain=NSCocoaErrorDomain Code=-1 "(null)"`
对 iOS 9 中的这种行为有任何想法吗?任何帮助表示赞赏!谢谢