I’m using RestKit for HTTP requests, and with some request, I get JSON response with some busses:
[{"bus_number":"1","created_at":"2011-08-15T23:07:52Z","id":1,"model":"Setra","registar_number":"123456","seats":50,"tour_id":1,"updated_at":"2011-08-15T23:07:52Z"},{"bus_number":"2","created_at":"2011-08-15T23:07:52Z","id":2,"model":"Mercedes","registar_number":"2234","seats":60,"tour_id":1,"updated_at":"2011-08-15T23:07:52Z"}]
I’m getting it into method:
- (void)request:(RKRequest*)request didLoadResponse:(RKResponse*)response {
NSLog(@"%@", [response bodyAsString]);
}
Becouse, I have multiple busses in this JSON, how can I easily parse/decode or whathever do to convert this into NSArray or something for easily accesing into elements?
EDIT: I need code sample how to do this with JSONKit, who is already implemented in RESTKit.
json-framework is one of many third-party libraries you can use to parse JSON.