我有这个数组items
var items: [String] = []
而prizes[0]
是__NSCFDictionary
其中一个键值对是
键:to_prizes
值:
Optional(<__NSCFArray 0x787dbfb0>(
94761178,
71959593,
36665808,
54185273,
18953944,
347,
790
)
我怎样才能使swift字符串数组items
成为[94761178
,....,790
]
答案 0 :(得分:2)
您可以像这样访问此路径:
let prizesDictionary = prizes[0] as NSDictionary
let toPrizesArray = prizesDictionary["to_prizes"] as NSArray
var items: [String] = toPrizesArray as [AnyObject] as [String]