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
ganesh kamma
928 PointsNSDictionary *album = [[NSDictionary alloc] initWithObjectsAndKeys:@"title", @"Abbey", @"artists", @"The Beatles", nil];
I tried above code many times. It simply does not work. I am stuck here. Need help
Stone Preston
42,016 Pointscould you post a link to the challenge you are referring to
ganesh kamma
928 PointsPrevious discussion on same topic link : https://teamtreehouse.com/forum/having-problem-with-nsdictionary
4 Answers
Stone Preston
42,016 PointsNSDictionary *album = [[NSDictionary alloc] initWithObjectsAndKeys:@"title", @"Abbey", @"artists", @"The Beatles", nil];
the key artists probably needs to be singular (artist not artists) and the title is Abbey Road, not just Abbey
maybe try
NSDictionary *album = [[NSDictionary alloc] initWithObjectsAndKeys:@"title", @"Abbey Road", @"artist", @"The Beatles", nil];
Stone Preston
42,016 Pointsah, I noticed also you are inserting the objects and keys in the wrong order. The object comes first, then the key. try using
NSDictionary *album = [[NSDictionary alloc] initWithObjectsAndKeys:@"Abbey Road", @"title", @"The Beatles", @"artist", nil];
so the things that were incorrect were you were inserting your key value pairs in the wrong order, you used artists instead of artist as your key, and Abbey instead of Abbey Road as a value.
ganesh kamma
928 PointsI tried again does not work. ERROR message: Bummer! Your 'album' dictionary doesn't have any values in it. thanks for reply with in short time
ganesh kamma
928 PointsNow I got it. Awesome . Thanks you.
ganesh kamma
928 Pointsganesh kamma
928 PointsPrevious few people post same problem and some solution. However no useful. Thanks