简体   繁体   English

解析 JSon 数据 FlightAware

[英]Parsing JSon Data FlightAware

I am using the flight aware service to get flight information but I am having trouble getting the data in a way I can use.我正在使用航班感知服务来获取航班信息,但我无法以我可以使用的方式获取数据。

Json response is: Json 回复是:

{
    "AirlineInfoResult": {
        "name": "US Airways",
        "shortname": "US Airways",
        "callsign": "Cactus",
        "location": "Tempe, AZ",
        "country": "United States",
        "url": "http://www.usairways.com/",
        "phone": "+1-800-428-4322"
    }
}    

And this is the code I am using but nothing is returned这是我正在使用的代码,但没有返回任何内容

NSMutableDictionary * routeRes;
routeRes = [json objectForKey: @"AirlineInfoResult"];
NSMutableArray * res;
res = [json objectForKey: @"url"];
for (NSMutableDictionary * flight in res) {
    NSLog(@"actual arrival time= %@", [flight objectForKey: @"url"]);
}   

What am I missing in getting this data?获取这些数据时我缺少什么?

change below line:更改以下行:

res = [json objectForKey:@"url"]; res = [json objectForKey:@"url"];

with

res = [routeRes objectForKey:@"url"]; res = [routeRes objectForKey:@"url"];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM