How to add JSON files to my project
I am writing a twitter client program. They have given JSON开发者_运维问答 files to include in my project. But I am confused with how to add them into my project. And actually what the JSON files do ?
JSON is Javascript Object Notation. It is a serialized form of a javascript object. Javascript can natively eval JSON code, so you need to eval that code somehow. It kind of depends how the files are setup and whether you want to keep the separate from your main javascript code.
One easy thing to do is create an AJAX call that downloads the file and then eval it that way. Something else you can do is copy the code into your main javascript as a string and eval that string. If the file is setup correctly, or you want to modify it, you can eval the code directly in the file into a global object you can then use.
Hope that helps.
I know that there is a project on google code for json with objective-c: touchJSON
You can read the documentation on the json website :D it is very clear.
Please take a look and see if it helps.
精彩评论