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!
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
Joey LoForti
Courses Plus Student 1,864 PointsChallenge task 3 of 3 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'.
Seems like this should be the answer
NSDictionary *album = @{ @"title":@"Abbey Road", @"artist":@"The Beatles" }; NSLog(@"album %@", album);
NSMutableDictionary *albumMutable = [NSMutableDictionary dictionaryWithDictionary:album]; [albumMutable setObject:@1969 forKey:@"year"]; NSLog(@"%@", albumMutable);
4 Answers

Trey Chad
3,535 PointsI had the same issue. Stone is right, 1969 needs to be a string, and you have it declared as an integer.
So the line of code should be:
[albumMutable setObject:@"1969" .... instead of [albumMutable setObject:@1969

Stone Preston
42,016 PointsIs it possible it wants the year as a string not an integer?

Liam Herbert
15,140 PointsHello,
I was stuck with the same problem I had the code as: setObject:@1969
Then I tried it as: setObject:@"1969"
And Booya! It worked.

Matteo Giuzzi
1,913 PointsBut can't you fix this? The right answer should be @1969 and not @"1969"....

Stone Preston
42,016 Pointswell the challenge says "Where the key is a NSString 'year' and the value is also a NSString '1969'." It tells you it needs to be a string. So the right answer is @"1969"

Matteo Giuzzi
1,913 Pointsyou're right, thank you for the clarification!