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 Swift Basics (retired) Collections Modifying an Array

Aby Abraham
PLUS
Aby Abraham
Courses Plus Student 12,531 Points

Append code not working.

For Challenge Task 1 of 3 in Arrays Chapter (task to append two more strings), I am "Bummered".

I tried both the codes below; todo.append ("Debug App", "Fix Bugs")

//todo.append ("Debug App") //todo.append ("Fix Bugs")

Both are giving error. The Preview pane is blank.

arrays.swift
var todo = ["Learn Swift", "Build App", "Deploy App"]
todo.append ("Debug App", "Fix Bugs")

//todo.append ("Debug App")
//todo.append ("Fix Bugs")

5 Answers

We just applied a fix for Xcode on our servers. The preview pane should now show compiler errors correctly again. Sorry for the problem.

Aby Abraham
Aby Abraham
Courses Plus Student 12,531 Points

Thanks Myers. It is working now. Update worked!!!

AR Ehsan
AR Ehsan
7,912 Points

Mine was blank too!

AR Ehsan
AR Ehsan
7,912 Points

Solution var todo = ["Learn Swift", "Build App", "Deploy App"] todo.append ("Debug App") todo.append ("Fix Bugs") let item = todo.removeatindex (2)

AR Ehsan
AR Ehsan
7,912 Points

var todo = ["Learn Swift", "Build App", "Deploy App"] todo.append ("Debug App") todo.append ("Fix Bugs") Let item = todo.removeatindex (2)

AR Ehsan
AR Ehsan
7,912 Points

Please mark as best answer if it helped