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 Build a Simple iPhone App with Swift Getting Started with Xcode A Swift Recap

Bummer! Your `favoriteSports` variable has the wrong value in it: `[football, basketball, tennis, voleyball]`.

Neither append nor insert work for this task, it's still giving me the same error. Am I completely stupid and missing something, or is it a bug?

getting_started.swift
let bestSmartphone = "iPhone"

var favoriteSports: [String] = ["football", "basketball", "tennis"]

favoriteSports.append("voleyball")

5 Answers

voleyball is misspelled.

everything seems right to me except for strings. I don't believe it's has to be there for the challenge. although its right because it work fine for me in playground.

var favoriteSports = ["football", "basketball", "tennis"]

The challenge it's displaying the error at is the 3rd one, which states 'Whoops, we forgot that volleyball is also one of our favorite sports. Add the string "volleyball" to our favoriteSports array.'

Appending 'voleyball' for this task does not work. Neither does inserting it.

Looks like I'm an idiot. Thanks!

I had the same error, I tried 10 times. Then finally passed it.

favoriteSports.append("volleyball")