gpt4 book ai didi

iphone - 我的应用程序如何保存和打开 iPhone 照片库中的照片?

转载 作者:行者123 更新时间:2023-12-03 21:24:20 25 4
gpt4 key购买 nike

如何通过我的应用保存和打开 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);

(示例代码:)

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];
}

关于iphone - 我的应用程序如何保存和打开 iPhone 照片库中的照片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1997592/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com