0
我需要解析Apple JSON,但我有一個小問題。現在我這樣做:JSON解析返回null
的問題是在這裏:
- (void)fetchedData:(NSData *)responseData {
NSError* error;
NSDictionary* json = [NSJSONSerialization JSONObjectWithData:responseData
options:kNilOptions
error:&error];
NSNumber *resultCount = [json objectForKey:@"resultCount"];
NSLog(@"%i", [resultCount intValue]);
NSArray * AppStoreUrlParse = [json objectForKey:@"results"];
NSDictionary* StoreParse = [AppStoreUrlParse objectAtIndex:0];
NSLog(@"%@", [json objectForKey:@"price"]);
}
在此行中:
NSLog(@"%i", [resultCount intValue]);
的是NSLog的returing:1像JSON(http://itunes.apple.com/lookup?id=387633954)
但是在這條線上
NSLog(@"%@", [json objectForKey:@"price"]);
NSLOG返回(空)
沒有人知道我可以從json得到價格嗎?
對我的作品感謝,會在4分鐘內接受你的回答 – Jones