我有json对象。我正在解析json并将其存储为disctionary。现在我想从disctionary获取这些数组,但是当我使用objectForKey(“comingsentointments”)时,它什么都没给我
{
"upcomingAppointments": [],
"upcomingFollowUps": [],
"followUps": []
}
答案 0 :(得分:1)
试试这个:
var dictionary = //NSDictionary from somewhere...
if let upcomingAppointments = dictionary["upcomingAppointments"] as? NSArray {
//Process your appointments here.
}
//Same goes for other such json fields.