开发者

How to convert JSON data to Objects in iPhone [duplicate]

开发者 https://www.devze.com 2023-02-24 01:06 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How to get and parse JSON using objective C?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to get and parse JSON using objective C?

Recently I have discovered JSON can be used to send data to iPhone.

开发者_开发百科

In my application there is lot of communication between the server so I construct lot of objects (classes) in various places. Currently I am manually constructing my classes from the data I get from json.

Is there a framework or source code that does this conversion automatically after all we know object information we get from the service. I can pass the class structure and it will create a Array of those objects from json data.


Yes:

http://code.google.com/p/json-framework/

Import the framework, send the JSON string -[NSString JSONValue] and you'll get back either an NSDictionary or an NSArray.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号