I'm trying to fill my arrays with datas in JSONArray
that i get from server and I'm doing that with this code(swift 3 Xcode 8):
func parseReservationJson(_ anyObject:Array<AnyObject>){
nodes.removeAll()
reservations.removeAll()
for anyObj in anyObject{
let client_name = (anyObj["client_name"] as? String) ?? ""
let client_family = (anyObj["client_family"] as? String) ?? ""
let ft_of_time = ((anyObj["ft_of_time"] as AnyObject as! NSString).substring(to: 5) as NSString)
}
}
But I'm getting this error for the last line of for
statement :
Could not cast value of type '_SwiftValue' (0x112d8a898) to 'NSString' (0x11003eab8).
what is wrong?