Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我的应用程序如何保存和打开iPhone上的照片';s照片库?_Iphone_Objective C_Cocoa Touch - Fatal编程技术网

我的应用程序如何保存和打开iPhone上的照片';s照片库?

我的应用程序如何保存和打开iPhone上的照片';s照片库?,iphone,objective-c,cocoa-touch,Iphone,Objective C,Cocoa Touch,如何从我的应用程序中保存和打开iPhone照片库中的照片? 代码会很有帮助。这允许您将图像保存到相册中: // Adds a photo to the saved photos album. The optional completionSelector should have the form: // - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)co

如何从我的应用程序中保存和打开iPhone照片库中的照片?
代码会很有帮助。

这允许您将图像保存到相册中:

// Adds a photo to the saved photos album.  The optional completionSelector should have the form:
//  - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo;
UIKIT_EXTERN void UIImageWriteToSavedPhotosAlbum(UIImage *image, id completionTarget, SEL completionSelector, void *contextInfo);
(示例代码:)


你能做的最好的事情就是把一张精选的照片保存在你自己的应用程序可写目录中,并继续使用它。。。请注意,如果多次保存到用户库,则每次都会创建一个新图像


你可能想向苹果公司提交一份文件,以便直接访问该文件,或者给你一些可以用来查看该文件的参考资料(例如查看EXIF)。

下次我启动我的应用程序时,如果用户不必从UIImagePickerController中选择图像,如何重新打开该图像?不幸的是,在进行了一些挖掘之后,对于通过AppStore发布的应用程序,这可能是不可能的。您可以将它们保存到相册和自己的目录中(并且您可以毫无问题地打开自己目录中的相册),但应用程序似乎无权访问相机的相册。
IImageWriteToSavedPhotosAlbum( image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil );  


/// called function, alerts user when the image has been saved:

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo {
    [ [ self parentViewController ] dismissModalViewControllerAnimated: YES];   
}