user3044505 user3044505 - 3 months ago 16
Objective-C Question

How to fetch this response in one array

this response i am getting from web service. how to fetch only cities record??

Data = (
{
Cities = (
{
CityCode = 21;
Name = Cork;
Numbers = (
{
Number = 2349990;
PauseOne = 3;
PauseTwo = 3;
}`enter code here`
);
}
)

Answer
NSDictionary *cities = myJson[@"Data"][0][@"Cities"][0];

NSLog(@"City Name is = %@", cities[@"Name"]);
NSLog(@"City Code is = %d", [cities[@"CityCode"] intValue]);