Should I read/write data directly from/to a plist file in the view controller or is it better to define a class for the model and then use its methods to read/write data?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends what you’re doing. If you are doing extensive work with the
.plistfile, then it’s probably better to write a class to handle all of the different things you’re doing to it. If you’re just taking one value out one time or something similar then you could write a class, but it’s not really a significant issue.You don’t want your view controller to end up doing a lot of the lifting in areas that don’t pertain directly to the view, so just think about how much code you’ll be adding. If you think there’s a chance you might want to do more things with the
.plistfile then go ahead and write a class for it.