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 trialRyan Cocuzzo
1,206 PointsCode returning incorrect, anybody have any ideas?
self.quotes = [@"Haters gonna hate", @"Life is simple, not easy", @"Winners never quit,
quitters never win"];
3 Answers
Aaron Watkins
10,902 PointsHi 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"];
Aaron Watkins
10,902 Pointsah. ok. try this:
self.quotes = [NSArray arrayWithObjects: @"Haters gonna hate", @"Life is simple, not easy", @"Winners never quit, quitters never win", nil];
Ryan Cocuzzo
1,206 Pointsthat too does not appear to be working
Aaron Watkins
10,902 Pointshmm...i just tried it in the code challenge and it worked for me.
Stephen Whitfield
16,771 PointsMake 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.
Ryan Cocuzzo
1,206 PointsRyan Cocuzzo
1,206 Pointsthe 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