[Xcode 7.1,iOS 9.1]
我有一个数组: var array: [String] = ["11", "43", "26", "11", "45", "40"]
var array: [String] = ["11", "43", "26", "11", "45", "40"]
我想将它(每个索引)转换为一个Int,所以我可以使用它从一个定时器倒计时,相应的索引.
如何在Swift 2中将String数组转换为数组Int?
String
Int
我已经尝试了几个链接,没有一个工作,所有这些都给了我一个错误.链接中的大多数代码都已折旧或尚未更新为swift 2,例如toInt()方法.
toInt()
arrays string int swift swift2
arrays ×1
int ×1
string ×1
swift ×1
swift2 ×1