【发布时间】:2014-06-18 17:51:03
【问题描述】:
在 swift 中,不可变数组中的值可以更改,但不可变字典中的值不能更改,为什么?
let imArray = ["Ram","Shyam","Bharat"]
imArray[2] = "Abhimanyu" // this change will be apply though it is immutable
【问题讨论】:
-
因为
Array()的下标 是nonmutating函数。
标签: swift