0

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!

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.