I want to parse JSON in Objective-C in iOS using AFNetworking library
{
"success": 1,
"row": [
{
"amount": 2800
}
]
}
CODE -
arrAmount = [responseObject valueForKey:@"row"];
NSLog(@"%@",arrAmount);
NSString *strAmount =[NSString stringWithFormat:@"%@", [arrAmount valueForKey:@"amount"]];
self.lblAmount.text =[NSString stringWithFormat:@"%@",strAmount];
Use
objectForKey
instead ofvalueForKey
Response of
row
contain array not Dictionary, so access amount from first object of Array.use NSDictionary: