Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRicardo Gonzalez
2,286 PointsDon't know what I am doing wrong.
It is telling me that the value is wrong
var todo = ["Learn Swift", "Build App", "Deploy App"]
todo += ["Debug App","Fix Bugs"]
todo.removeAtIndex(2)
let item = "Deploy App"
todo.insert("Learn ios", atIndex: 1)
1 Answer
kirkbyo
15,791 PointsThe problem is with your "Learn ios"
string. The challenge is case sensitive, to pass the challenge simple change your last line to:
todo.insert("Learn iOS", atIndex: 1)
If you need any more help, let me know!
Ozzie
Ricardo Gonzalez
2,286 PointsRicardo Gonzalez
2,286 PointsHey kirkbyo thanks for the help but even though it still won't let me pass even though i fix what you told me to fix
kirkbyo
15,791 Pointskirkbyo
15,791 PointsHey, I am assuming that you are just posting all the code in the first challenge? if that's the case try adding each line individually.
Task 1
Task 2
let item = todo.removeAtIndex(2)
I missed the a issue with the original question also. When removing an item from the array with the
removeAtIndex
method, it automatically assigns it to a variable. So when removing the item from the array it will set the value of the index passed.Task 3
todo.insert("Learn iOS", atIndex: 1)
Let me know if that works.
Ricardo Gonzalez
2,286 PointsRicardo Gonzalez
2,286 PointsNo i wasn't doing that but i found what my mistake was.Thanks anyways :)