我有这个Objective C代码:
NSMutableArray *dataArray = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:&error];
NSLog(@"Dictionary = %@",dataArray);
NSMutableArray *venues = [[NSMutableArray alloc] init];
for (NSDictionary *venueDic in dataArray) {
MapPoint *mapPoint = [[MapPoint alloc] init];
mapPoint.name = [venueDic objectForKey:@"name"];
mapPoint.image_path = [venueDic objectForKey:@"image_path"];
[venues addObject:mapPoint];
NSLog(@"Venue Name: %@", mapPoint.name);
}
但我正在努力翻译FOR循环。我花了好几个小时都在寻找解决方案。