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 trialSteve Hunter
57,712 PointsCreate an instance of Song using the designated initializer.
I'm stuck on this quiz question - I've been round in circles for a while now!
There's three questions. First is 'use alloc and init':
Song *popSong = [[Song alloc] init];
Works fine.
Second is using the convenience constructor:
Song *popSong = [Song songWithSinger:@"James Brown"];
Works fine.
The last is using the designated initializer - and this is where I'm going wrong. My suggestion isn't correct but I have no idea why! I came up with:
Song *popSong = [[Song alloc] initWithSinger:@"James Brown"];
I'm confused at this one - I can't see what I've, obviously, done wrong!
Thanks,
Steve.
2 Answers
Holger Liesegang
50,595 PointsHi Steve,
sorry to say that, but
[[Song alloc] initWithSinger:@"James Brown"]
worked just fine as the solution for question 3 of 3 ( and I even c&p the relevant part of it out of your solution into the answer field)
Steve Hunter
57,712 PointsWeird! Didn't work for me! :-)