Q:

Add values in a particular array element in swift

I have this simple app which asks input from a user and stored in an array. Now, for example I have stored an int value of "5" in array[2] in coreData. Now I want to add another element to the one that I have already in store. I have another number "6" to add in array[2] now the result would be array[2] = 11... How do I do it guys? I'm still new to swift... Thanks in advance!

A:

you can do it this way :
var arr = [1,3,5,4,6,7]

arr[2] = arr[2] + 6

println(arr[2])

And the result will be 11.
May be this will help you.

