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 trialVidit Shah
6,037 PointsBummer!The year set is not the correct value
NSDictionary *album=@{@"title":@"Abbey Road",@"artist":@"The Beatles"}; NSMutableDictionary *albumMutable=[NSMutableDictionary dictionaryWithDictionary:album]; [albumMutable setObject:@1969 forKey:@"year"]; don't know what's wrong in the code
4 Answers
Stone Preston
42,016 Pointsyear probably needs to be a string, not an NSNumber:
[albumMutable setObject:@"1969" forKey:@"year"];
below is your full code with the year changed to a string:
NSDictionary *album=@{@"title":@"Abbey Road",@"artist":@"The Beatles"};
NSMutableDictionary *albumMutable=[NSMutableDictionary dictionaryWithDictionary:album];
[albumMutable setObject:@"1969" forKey:@"year"];
Vidit Shah
6,037 PointsThank you so much Brother :)
Vidit Shah
6,037 PointsThank you so m8ch Brother :)
Camilo Castro
Courses Plus Student 2,549 PointsWhat was the question for the problem?