I'm not sure if this is even possible on the iphone.
Scenario 1:
I get some json object by calling some api through a URL. I parse the json on my iphone and display results.
OR
Scenario 2
But let's say I get some json object by calling some api through URL. I pass the object to a web service to pa开发者_如何学Pythonrse it with C# and return the data organized the way I want then parse it again (but obviously nicer and cleaner parsing)Which one do you think is better if both are possible?!
Thanks
Parsing JSON on the iPhone is very easy. I suggest using SBJSON (https://code.google.com/p/json-framework/downloads/list), it will parse the JSON in objects for you.
Here is a tutorial: http://iosdevelopertips.com/cocoa/json-framework-for-iphone-part-2.html
#1 is definitely better. Why would you parse the JSON with C# only to put it in a different format and then re-parse it? That seems needlessly inefficient.
Depends on the size of the JSON objects and the amount you need to download.
Apple mentioned, on one of their WWDC 2010 videos, that for large list downloads, using compressed plist formatted data is more efficient overall, in terms of total battery consumption, than JSON or XML. But for small and infrequent downloads, the difference is probably negligible, and not transcoding JSON will result is far less total system complexity.
精彩评论