0
{"aps":{
        "alert":"New Test For The Win",
        "sound":"default"
        },
  "fk_device":"1513"
}

我有这个 JSON NSString。如何解析这个 JSON 字符串并获取 fk_device 值?

4

1 回答 1

2

你可以试试这个库JSONKit。要获取字符串,您可以执行以下操作:

NSDictionary *deserializedData = [jsonString objectFromJSONString];
NSString *string = [deserializedData objectForKey:@"fk_device"];
于 2012-11-04T17:07:45.743 回答