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 trial

iOS

In Swift 2.0, I was not able to use do-while loop.

I received an error message with the code below:

do {
    print(todo[index])
    index++
} while index < todo.count

The system asked me to use repeat-while instead. After changing "do" to "repeat", there is an error for "index++" because of EXC_BAD_INSTRUCTION.

I have no idea where I did wrong.

Which challenge is this? Or video?

It's my understanding that in Swift 2.0 you use the keyword 'repeat' instead of 'do' - no more do-while. There must be more to your code than this. Where do you declare the todo array and the index variable?

Yes, things have changed a little from the time of making the videos. For example you don't use ''println'' anymore either, you use ''print''. Check the error codes for some hints, like Brendan said there's no more do-whiles, it's 'repeat' now. Remember it's a new language and constantly evolving :)

There's a workshop video on treehouse which covers the new Swift 2.0 features. You can access that video here: https://teamtreehouse.com/library/whats-new-in-swift-20

Wasn't the Swift 2.0 course created taking these changes into account?