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

Using 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

This 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"];

Its 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

I figured it out. I don't need to use alloc because of the convenience constructor.

Then 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?

I'm having the same trouble - did you solve this in the end?

Same here. Whats up here?

Please fix this! Just wasted half an hour before google it. This is a frivolous bug that should be addressed

I can confirm that the bug is still there.

And... the bug is still there.

The bug is still there. I couldn't figure out what I was doing wrong until I found this post.

Bug is still there. Please fix this. =)