Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Objective-C Basics (Retired) Foundation Framework NSDictionary

Gundra Kiran
PLUS
Gundra Kiran
Courses Plus Student 5,931 Points

"Your 'album' dictionary doesn't have any values in it". But I feel that my statement is syntatically correct, pls help

I working Dictionaries in objective c.

Jhoan Arango
Jhoan Arango
14,575 Points

Sorry I wish I could help you with this answer, I don't speak Objective-C .. :( I work with Swift.

But heads up, show your code for the next person to be able to help you.

Gundra Kiran
Gundra Kiran
Courses Plus Student 5,931 Points

NSDictionary *album = @{@"title":@"Abbey Road",@"artist":@"Beatels"}; on this statement I am facing trouble.

1 Answer

Martin Wildfeuer
PLUS
Martin Wildfeuer
Courses Plus Student 11,071 Points

Although you are declaring your Dictionary correctly, your values don't match those asked for in the assignment:

Declare an NSDictionary variable named 'album'. Assign the following key/pairs to it: "title" - "Abbey Road", "artist" - "The Beatles".

So instead of the artist being "Beatels"...

NSDictionary *album = @{ @"title": @"Abbey Road", @"artist": @"Beatels" };

... it has to be "The Beatles"

NSDictionary *album = @{ @"title": @"Abbey Road", @"artist": @"The Beatles" };

Make sure to follow the instructions in detail, code check will only ever pass if your values and names are exactly the same as in the assignment.

Hope that helps :)