{ id:4, price: 471, location: "New York", size: 3000 }, { id:7, price: 432, location: "London", size: 3200 }, { id:22, price: 528, location: "Tokyo", size: 2000 }
This is an array of dictionaries ... you can create the Modal class of your house (attribute: id, price, location, size) and repeat it as follows (given that you finally have the above) ..
NSArray *houses = [dictionary objectForKey:<youHaveNotProvideItInYourData>]; NSMutableArray *populatedHouseArray = [[NSMutableArray alloc]init]; for(int i=0;i<[houses count];i++) { NSDictionary *tempDictionary = [houses objectAtIndex:i]; House *tempHouse = [[House alloc]init]; if([tempDictionary objectForKey:@"id"]!=nil { tempHouse.id = [tempDictionary objectForKey:@"id"]; }
Thanks,
Ravin source share