如何将文件从文件夹复制到ios中的照片库

时间:2014-12-15 13:00:03

标签: ios iphone

我不确定我是否错过了互联网上的网址。我正在尝试将文件[jpeg文件]从Document文件夹复制或移动到iOS中的PhotoGallery。 iOS中是否有可用的API?

另外,

有没有办法为Document文件夹设置通知处理程序,在文件夹中创建文件时,我的回调应该被触发,我将把文件从文件夹移动到照片库。

1 个答案:

答案 0 :(得分:1)

你可以这样做:

UIImageWriteToSavedPhotosAlbum (image, self, @selector(image:didFinishSavingWithError:contextInfo:) , nil);

回调方法签名是:

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo

稍后修改

如果您希望收到有关文件更改的通知,可以在此处找到一些答案:Notification of changes to the iPhone's /Documents directory