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

Ryan Cocuzzo
Ryan Cocuzzo
1,206 Points

Code returning incorrect, anybody have any ideas?

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

3 Answers

Hi hmm...is the "quitters never win" part on the same line as the "winners never quit"? looking at the way it's structured in your example above, it seems like you may have a break in which Xcode may think it's not a part of the array. Is the code compiling or do you get an error before it builds/runs?

self.quotes = [@"Haters gonna hate", @"Life is simple, not easy", @"Winners never quit, quitters never win"];
Ryan Cocuzzo
Ryan Cocuzzo
1,206 Points

the code is not for Xcode, it is for a challenge as part of the treehouse course, the code is not correct and the error reports are not very helpful

ah. ok. try this:

self.quotes = [NSArray arrayWithObjects: @"Haters gonna hate", @"Life is simple, not easy", @"Winners never quit, quitters never win", nil];
Ryan Cocuzzo
Ryan Cocuzzo
1,206 Points

that too does not appear to be working

hmm...i just tried it in the code challenge and it worked for me.

Make sure you're following the directions closely and providing the compiler with everything the quiz is asking you for. Your code appears to be correct, so I can't see the issue in what you have provided.