I want to fetch data from my web server, and put it into a UITableView. This data includes three values for each row (eMail, Userid, and status (online or not)). Now what’s the best way to print out this data on the Webserver that I can convert it into something like an Array in the App? How this works with one simple string I know, and I found JSON-Tutorials on the internet, but the links where you can download JSON for iOS SDK are not available. Or is there an even better way to fetch an Array from a server?
The server has to “print out” a multidimensional array with email, userid and status for each contact.
Thanks very much for help!
#import <JSON/JSON.h> doesn’t work, the file wasn’t found.
You need to use NSJSONSerialization (Only available in iOS 5)
Here is a link with a tutorial demonstrating how to use it: http://www.raywenderlich.com/5492/working-with-json-in-ios-5
For iOS 4 and below, you should check out the SBJSON Library.
Using the above methods, you can convert the data into an
NSArray, of which can be used in aUITableView.