I am new to iOS programming and have written a simple reminder style application, now I rewrite it to correctly implement the MVC model, since previously all my codes were inside the view controllers.
I have my own Event class with the name of the property, time, repetition, etc., and then the following structure:
Model class
Retrieves, processes, and saves data in NSUserDefaults
Rootootcontroller
Creates an instance of the Model object and asks the model to return all Events objects from NSUserDefaults , and then displays them in a UITableView
EditEventViewController
[editEventVC initWithEvent:theEvent];
Skips the specific event object that was selected in the table cell by the init method and displays all editable properties
EditEventPropertyViewController
[editEventPropertyVC initWithValue:propertyValue];
Skips the value of the property for editing (for example, the name of the event) using the init method and returns the updated value of the user through the delegation method
Is this the right way to implement this application?
What is the best way to save an updated Event object to NSUserDefaults via the model after completion with EditEventViewController? Through the delegate? I am currently reloading the uitableview data on viewWillAppear in the root controller, so it will need to save the updated data before loading it again.
thanks