赵红霞不雅视频12秒,shelley mulshine,新妹魔王的契约者 动漫
1、获取沙盒路径
nsstring *path_document=nshomedirectory(); //设置存储文件路径!!!!!!文件路径的名字一定要区分开 nsstring *imagepath=[path_document stringbyappendingstring:[nsstring stringwithformat:@"/documents/%@%@%@.png",_shopobj.shoppicture,_shopobj.shopcolor,self.shopobj.shopname]]; //写入文件 [uiimagepngrepresentation(img) writetofile:imagepath atomically:yes]; //将地址存储到自己设置的model模型中 self.shopobj.shoppicture=imagepath;
2、读取数据的时候,直接从自己设置文件中读取出来就行了,例子如下:
nsstring *path_document=nshomedirectory(); nsstring *imagepath=[path_document stringbyappendingstring:[nsstring stringwithformat:@"/documents/%@%@%@.png",_shopobj.shoppicture,_shopobj.shopcolor,self.shopobj.shopname]]; uiimage *img=[uiimage imagewithcontentsoffile:imagepath]; cell.imgv.image=img;
顺便说一下设置的根目录的位置:
2,获取documents目录路径的方法:
nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *docdir = [paths objectatindex:0];
3,获取caches目录路径的方法:
nsarray *paths = nssearchpathfordirectoriesindomains(nscachesdirectory, nsuserdomainmask, yes); nsstring *cachesdir = [paths objectatindex:0];
4,获取tmp目录路径的方法:
nsstring *tmpdir = nstemporarydirectory();
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
iOS 使用UITextField自定义搜索框 实现用户输入完之后“实时搜索”功能
网友评论