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

Error with INSERT

I seem to be getting the following error error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0). when trying to add

todo.insert("Watch TV", at: 1)

Any advice would be much appreciated.

Error Screenshot

Paolo Scamardella
Paolo Scamardella
24,828 Points

You need to post some additional code in order for others to help you. At this point, I cannot tell what type is todo. I'm guessing it is an array of strings, but I suspect that todo is nil.

Thanks for your reply. Restarting xcode removed the error.