你如何用NSUserDefaults保存图片? [英] How do you save a picture with NSUserDefaults?

查看:128
本文介绍了你如何用NSUserDefaults保存图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以拍照的iPad应用程序,然后将其放在图像视图中。如何保存我在图像视图中存储的图片?以下是我到目前为止所尝试的内容:[imageView setImage:[[NSUserDefaults standardUserDefaults] objectForKey:@storedImageValue6]];

I have a iPad app that can take a picture and then put it within a image view. How do I go about saving the pic that I have stored in the image view? Here is what I have tried so far: [imageView setImage:[[NSUserDefaults standardUserDefaults] objectForKey:@"storedImageValue6"]];

推荐答案

你必须将它转换为NSData,反之亦然。请看一下这个链接:在NSUserDefaults中保存图像?

Pretty much you have to convert it to NSData and vice versa. Take a look at this link: Save images in NSUserDefaults?

这篇关于你如何用NSUserDefaults保存图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆