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 Creating a Data Model Creating a Data Collection

Ross Koller
Ross Koller
340 Points

var shoppingListArray = ["toothpaste", "bread", "eggs"] that is the code that I entered, what am I doing wrong? Thanks

The error doesn't give any details but says to look at the preview but the preview doesn't show anything, it's just blank.

data_collections.swift
var shoppingListArray = ["toothpaste", "bread", "eggs"]
Heather Woods
Heather Woods
5,330 Points

I think you forgot the semi colon at the end of the bracket.

Addison Francisco
Addison Francisco
9,561 Points

Heather Woods, Semi colons are actually not required in swift :)

1 Answer

Addison Francisco
Addison Francisco
9,561 Points

Your var name does not match the requirements for the challenge. Try this instead...

var shoppingList = ["toothpaste", "bread", "eggs"]