そのjSon応答をどのように割り当てることができNSArray
ますか?
jSON:
[{"city":"Entry 1"},{"city":"Entry 2"},{"city":"Entry 3"}]
コード:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSArray *jsonData = [responseData objectFromJSONData];
for (NSDictionary *dict in jsonData) {
cellsCity = [[NSArray alloc] initWithObjects:[dict objectForKey:@"city"], nil];
}
}