我需要一些关于我正在处理的数组的帮助。
我从 JSON 查询中取回一些数据并将其写入一个数组,然后在第二个循环中我将该数组写入另一个数组,但我不知道如何将数据读回?这是代码: -
for (NSDictionary *weather in weatherarray)
{
int j = 1;
NSArray *hourlyArray = [weather objectForKey:@"hourly"];
for (NSDictionary *hourD in hourlyArray)
{
[multi addObject:Date];
[multi addObject:[hourD objectForKey:@"time"]];
[multi addObject:[hourD objectForKey:@"weatherCode"]];
[multi addObject:[hourD objectForKey:@"tempC"]];
[multi addObject:[hourD objectForKey:@"FeelsLikeC"]];
[multi addObject:[hourD objectForKey:@"chanceofrain"]];
[multi addObject:[hourD objectForKey:@"cloudcover"]];
[multi addObject:[hourD objectForKey:@"WindGustMiles"]];
[multi addObject:[hourD objectForKey:@"humidity"]];
[multi addObject:[hourD objectForKey:@"pressure"]];
j = j + 1;
}
[[multi1 objectAtIndex:j] addObject:multi];
i = i + 1;
}
NSLog(@"%@", [[[multi1 objectAtIndex:1] objectAtIndex:0] objectAtIndex:1]);
}
如您所见,我试图在 NSLog 的末尾读取数据,但我正在为此苦苦挣扎。有人可以帮忙吗??