count 与 capacity 有何区别
count 与 capacity 有何区别
import UIKit
var array = [1, 2, 3, 4, 5,6,7,8,9]
array.count //9
array.capacity //10
array.append(1)
array.append(2)
array.count //11
array.capacity //20
count 与 capacity 有何区别
import UIKit
var array = [1, 2, 3, 4, 5,6,7,8,9]
array.count //9
array.capacity //10
array.append(1)
array.append(2)
array.count //11
array.capacity //20
2014-11-12
举报