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 trial

iOS

Calling properties from custom data types that are embedded in dictionaries

If i have a dictionary. And inside the dictionary are custom data types. How do i go about calling only the properties of the custom data types via calling the dictionary?

2 Answers

Hi Mohamed,

First, you'd get your custom data-type out of the dictionary, using the key you assigned to it. Then, once you have a reference to your custom data-type, you'd call its properties and methods, as per usual.

oh then one by one I assign instances and put those instance into an array! Thank you so much!

I'm now away from my computer so I can't try it in Xcode, however, I guess it could be like "nameOfTheKey.nameOfTheProperty"