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 trialSara Worth
5,225 PointsHelp with NSMutable Dictionary
I've gone through the videos again and I can't figure out how to add elements from an array into an NSMutable Dictionary that has already been created. I get the general idea but I can't get the syntax right.
NSArray *shoeOrder = @[@"Charles Smith", @(9.5), @"loafer", @"brown"];
NSMutableDictionary *shoeOrderDict = [[NSMutableDictionary alloc] init];
[shoeOrderDict setValue:@(shoeOrder objectAtIndex:0) forKey:@"name"];
Sara Worth
5,225 PointsSara Worth
5,225 PointsOk I've figured I probably need to use setObject: instead of setValue. But I'm still not sure how to add the objects from the shoeOrder array.