我正在使用 JSON 解析 iTunes RSS 提要,但遇到了问题。以下代码对于movieName 输出之一运行正常,但我仍然没有得到movieSummary 输出。
-(void)connectionDidFinishLoading:(NSURLConnection *)connection {
allDataDictionary = [NSJSONSerialization JSONObjectWithData:webData options:0 error:nil];
feed = [allDataDictionary objectForKey:@"feed"];
arrayOfEntry = [feed objectForKey:@"entry"];
for (NSDictionary *dictionTitle in arrayOfEntry) {
NSDictionary *title = [dictionTitle objectForKey:@"title"];
NSString *labelTitle = [title objectForKey:@"label"];
[arrayLable addObject:labelTitle];
NSDictionary *summary = [dictionTitle objectForKey:@"summary"];
NSString *labelSummary = [summary objectForKey:@"label"];
[arraySummary addObject:labelSummary];
}
movieName.text = [arrayLable objectAtIndex:0];
movieSummary.text = [arraySummary objectAtIndex:0]; //This is not displaying
}
这是我正在解析的链接:http: //itunes.apple.com/us/rss/topmovies/limit=300/json