如何将 NSArray 存储在二级存储上? [英] How to store NSArray on Secondary storage?

查看:29
本文介绍了如何将 NSArray 存储在二级存储上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 iOS 新手,我想将 NSArray 中的值存储到二级存储中,以便我以后可以访问它,该数组是来自 Web 服务的大响应,我想解析并显示它,这不是有效的解析数组并存储在 sqlite DB 中,我想要另一种方法来保存该数组,可能在文本文件中,这样我就无法从文本文件中检索数据并通过我的解析函数对其进行解析.我们可以这样做吗?

I am new in iOS, i want to store the values in NSArray onto secondary storage so that i can access it later, The array is large response from web service, i want to parse and show it, It is not efficeint to parse the array and store in sqlite DB, I want alternate way to save that array, may be in text file, so that i cant retrieve data from text file and parse it by my parsing function. can we do that ?

请给我建议

提前致谢!

推荐答案

要将数组保存到文本文件,您可以使用方法 – writeToFile:atomically:,了解更多信息 这里 是函数的文档.

to save the array to a text file you can use the method – writeToFile:atomically:, for more information here is the documentation of the function.

这篇关于如何将 NSArray 存储在二级存储上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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