I am developing a contact list view in iOS. I have a model class with all the attributes like first/last names, email id etc. I also have a mutable array to save the phone nos. I know I can use a dictionary here. But my question is for an alternative.
I am thinking of using another model with phone no type and phone no as attributes, and save the objects of these class in the mutable array of the first model. I dont know how clear I am here, but I want to know is this a good way or is there any better way to do this?
Its really debatable what would be the best approach here. Having a separate model object for the type/number is good if you think you might need to add additional functionality in the future (validations, etc.). If you just need to store data, a dictionary will be fine.