简体   繁体   English

如何在本地存储 JSON 在 Iphone 中解析数据?

[英]how to store JSON Parse data in Iphone Locally?

I want to store JSON parse data(companyName and companyID) in Iphone locally.我想将 JSON 解析数据(公司名称和公司 ID)本地存储在 Iphone 中。 I also can add or delete JSON parse data(companyName and companyID) in store data.我还可以在存储数据中添加或删除 JSON 解析数据(公司名称和公司 ID)。

I'm sure this article will help you out... it's for Flickr but shows how to play with JSON:)我相信这篇文章会帮助你......它是为 Flickr 准备的,但展示了如何使用 JSON :)

http://iosdevelopertips.com/networking/iphone-json-flickr-tutorial-part-1.html http://iosdevelopertips.com/networking/iphone-json-flickr-tutorial-part-1.html

It depends on the amount of data you wanna store.这取决于您要存储的数据量。 If it's gonna be less then 1000 I would recommend you to store it as plist, otherwise you can use core data or SQLite.如果它小于 1000,我建议您将其存储为 plist,否则您可以使用核心数据或 SQLite。

you can try to use NSUserDefaults if it´s just about a single company, not a collection如果它只是一家公司,而不是一个集合,你可以尝试使用 NSUserDefaults

https://developer.apple.com/documentation/foundation/userdefaults https://developer.apple.com/documentation/foundation/userdefaults

if not SQLite would be the best solution如果不是 SQLite 将是最好的解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM