Is it possible to create JSON files from text?
if so, is there a preferred way to do this on iOS?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s nothing stopping you from persisting JSON objects to files but there’s not really “JSON files” in the sense that there’s XLS files.
JSON is a way of way of encoding objects into a textual format for lightweight data interchange.
http://en.wikipedia.org/wiki/JSON
You use JSON to turn objects into strings, typically transport over the wire between potentially disparate systems and then transform back to objects.
In iOS, there are may APIs to do this (which Ryan pointed out above):
https://stackoverflow.com/questions/286087/best-json-library-to-use-when-developing-an-iphone-application
If you wanted to save objects in JSON format to files, you can certainly do that:
Write a file on iOS