我試着四處搜索,找不到任何解決問題的東西。 這裏是這樣的JSON答覆,我想改變爲[的NSDictionary]:將字符串數據從json更改爲NSArray swift 3
let reply = "[{"qty":"3","price":"75000"},{"qty":"4","price":"75000"},
{"qty":"1","price":"60000"},{"qty":"2","price":"60000"},{"qty":"6","price":"80000"}]"
let array = [{"qty":"3","price":"75000"},{"qty":"4","price":"75000"},
{"qty":"1","price":"60000"},{"qty":"2","price":"60000"},{"qty":"6","price":"80000"}]
可有人請幫助我的例子。謝謝!
使用這個庫:https://github.com/SwiftyJSON/SwiftyJSON –
不要 - **永遠不要做** - 在Swift中使用'NSArray/NSDictionary'並結合'JSON'。 – vadian