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

I don't understand what is wrong??

Can someone help me with my coding please as I don't understand whats wrong!

4 Answers

What is wrong with this piece of code:

Let's add the year of the album to the 'albumMutable' variable. Where the key is a NSString 'year' and the value is also a NSString '1969'

[albumMutable setObject:@1969 forKey:@"year"];

Ethan Neff
Ethan Neff
27,057 Points

try @"1969" b/c it wants an NSString

J Scott Erickson
J Scott Erickson
11,883 Points

Is there a more specific question that you have? Or in general are you looking for guidance?

I can't believe I didnt think of that, why does a NSString have to have speech marks?