本文共 207 字,大约阅读时间需要 1 分钟。
已经不再是简单的赋值了,而且数据拷贝!
func testArray(){ var a = [1,2,3,4]; var b = a; //a.append(100); var c = b; c[1] = 20; print(a); //[1, 2, 3, 4] print(b); //[1, 2, 3, 4] print(c); //[1, 20, 3, 4]}
转载地址:http://uzkfi.baihongyu.com/