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
Sam Hermes
20,862 PointsUsing a Custom Class quiz
I'm stuck on a question in the Data Modeling badge.
The question asks: Create an instance of the Song class with the convenience constructor songWithSinger:(NSString *)s and singer named "James Brown".
I believe that the answer should be: Song *popSong = [[Song alloc] songWithSinger: @"James Brown"];
I've been researching this, and I'm just not sure what I'm doing incorrectly.
10 Answers
Michael Reining
10,101 PointsThis quiz was hard for me. I finally figured it out.
// basic
Song *popSong = [[Song alloc] init];
// convenience constructor
Song *popSong = [Song songWithSinger:@"James Brown"];
// initialize
[[Song alloc] initWithSinger:@"James Brown"];
James Godwin
936 PointsIts a bug, you have to make sure that there are no spaces after the colon and it should work http://teamtreehouse.com/forum/data-modeling-using-a-custom-class
Sam Hermes
20,862 PointsI figured it out. I don't need to use alloc because of the convenience constructor.
Chris Da Sie
5,374 PointsThen your statement should look like [Song songWithSinger: @"James Brown"]; ?
I've tried both methods and still seem to be getting it wrong. Am I missing something here?
James Godwin
936 PointsI'm having the same trouble - did you solve this in the end?
Rajeev Sharma
1,597 PointsSame here. Whats up here?
Oscar Morrison
11,211 PointsPlease fix this! Just wasted half an hour before google it. This is a frivolous bug that should be addressed
eirikvaa
18,015 PointsI can confirm that the bug is still there.
James Carney
16,255 PointsAnd... the bug is still there.
Andrew Kelly
4,738 PointsThe bug is still there. I couldn't figure out what I was doing wrong until I found this post.
Misha Shaposhnikov
8,718 PointsBug is still there. Please fix this. =)