gpt4 book ai didi

iphone - 将其存储在手机内存中 - 这可能吗?苹果?

转载 作者:行者123 更新时间:2023-11-28 20:39:28 25 4
gpt4 key购买 nike

是否可以从我的应用程序下载图像并将其存储在 iPhone 内存中?我的应用程序中有各种尺寸的图像(url)可用。如何从我的应用程序下载并将其存储在图库中?

最佳答案

这会将图像保存到画廊

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

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void*)contextInfo
{
if (error != NULL)
{
// handle error
}
else
{
// handle ok status
}
}

更多信息 - 开发人员文档页面 - https://developer.apple.com/library/ios/#documentation/uikit/reference/UIKitFunctionReference/Reference/reference.html

如何一站式下载和存储到图库:

    UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"your_image_address.com"]]], self, @selector(image:didFinishSavingWithError:contextInfo:), nil);

关于iphone - 将其存储在手机内存中 - 这可能吗?苹果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9206329/

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