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 (iOS7) Creating a Data Collection Create an NSArray Property

Challenge : Data Collection

What is wrong here?

self.quotes=[[NSArray alloc]initWithObjects:@"Haters gonna hate", @"Life is simple, not easy";@"Winners never quit, quitters never win",Nil];

self.quoteLabel.text=[self.quotes ObjectAtIndex:1];

They said that I need to use "self" (that I have already used)

Thanks in advance

1 Answer

Remember, Objective C is a case sensitive language.

self.quoteLabel.text=[self.quotes objectAtIndex: 1];

Note the difference between my code and yours, when I am saying "objectAtIndex: 1", my "o" on "object" is lowercase, yours is not, it is uppercase. Also, you appear to have a semi-colon in between @"Life is simple, not easy" and @"Winners never quit, quitters never win", Nil];. Replace the semi colon with a comma and there will be only one more thing left to fix. The last thing I have spotted is that your ",nil" terminator actually has a capital N instead of a lower case one.

These are problems that even the best programmers run into, you have all of the terminology down just watch for those pesky typos and capitals.

Hope that this helped and good luck with your iOS development!