I come from Android dev, so sorry if I\'m missing obvious iOS concepts here.
I have a JSON feed that looks like:
{\"directory\":[{\"id\":0,\"fName\":\"...\
you can use NSJSonSerialisation
or AFNetworking library. Here is the example of AFNetworking to parse json response
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager GET:@"http://example.com/resources.json" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"JSON: %@", responseObject);
NSDictionary *json = (NSDictionary *)responseObject;
NSArray *staffArray = json[@"directory"];
[staffArray enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL *stop){
Staff *staff = [[Staff alloc] init];
staff.id = [[obj objectForKey:@"id"] integerValue];
staff.fname = [obj objectForKey:@"fName"];
staff.lname = [obj objectForKey:@"lName"];
//add data to new array to store details
[detailsArray addObect:staff);
} ];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
then use Core Data framework
to store data.