我有數組:使用Swift修改數組中的對象?
var arrDicContact = udContact.valueForKey("arrDicContact") as [NSDictionary]
和我想改變在陣列的一個接觸:
for let dicx:NSDictionary in arrDicContact{
if (dic.valueForKey("name") as String) == selectedName{
//how to modify dic to newdic: dic = newdic
}
}
我可以爲循環使用爲int i從0到arrDicContact.count-1。但它沒有退出......我喜歡循環(for ... in ...)所以有人幫助我! :)很多。
在遍歷它 – DogCoffee 2015-06-03 02:43:53