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
Pedro Fernandes
5,847 PointsHow to organize multiple instances of a model object in an app?
Should I use a data controller similar to the one used in the iOS dev tutorials? Suggestions?
2 Answers
Holger Liesegang
50,595 PointsHi Pedro, I'm not sure if your question is still current so I'm going to make this short: It depends but in most cases you would just like to use an NSArray/NSMutableArray or NSDictionary/NSMutableDictionary to store the instances of your objects.
For this purpose I prefer building a class (in most cases that would be a NSViewController) as the model. This class would have a property of type NSArray/NSMutableArray or NSDictionary/NSMutableDictionary that will store the objects. Later on you can refer to the instances of your objects form every other class in your project that includes this model class.
Kind Regards Holger
Pedro Fernandes
5,847 PointsThanks for the answer!