I have a problem parsing the array of objects from the JSON result.
[
{
\"first_name\":\"vijay\",
\"last_name\":\"last\",
\"credi
@Dan Ray answer is correct, but if you want to avoid third-party librairies you can use NSJSONSerialization
:
Assuming that NSData *responseData
is containing your JSON.
NSArray *userData = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingAllowFragments error:nil];
NSMutableArray *creditCards = [NSMutableArray array];
for (NSDictionary *user in userData) {
[creditCards addObject:[user objectForKey:@"creditCardNumber"]];
}
Source: NSJSONSerialization.