i m new in iphone developing, I saw some videos and example for JSON parsing, that has used JSON framework but in some examples it has used the default method “JSON Serialization” then whats the real difference between them ? ok and i can easily read Json data from web services but How can i attach Query for data update,delete,or insert ??i don’t really know how to send some data with url for services?? if there is any example link or any tutorial or any guide line then tell plz me!!
Share
Answer for your first Question :
The earlier IOS SDK releases doesn’t contain any classes for JSON Parsing, so the only possibility was stick with third party libraries and frameworks (like SBJSon), but the past release 0f
IOS-5 SDK ( IOS-5.1 is ready) has the class
NSJSonSerializationwhich helps you to serialize and de-serialize your JSON Object in very easy manner, also the performance wise the Apple’s class took the first place.Answer for your second Question :
The
NSJSONSerializationclass is the suitable answer for your second question. It has two methods+ (id)JSONObjectWithData:(NSData *)data options:(NSJSONReadingOptions)opt error:(NSError **)errorfor parsing JSON Data and+ (NSData *)dataWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError **)errorfor Creating JSON Object As well.As always newbie it’s pretty hard to get success in the first try. So follow this tutorial and this to know more about it, and apple always stands top at their documentation don’t forgot to check this one. Hope you get clear idea about it.