What is the correct way of implementing true MVC in Objective-C (Cocoa/iPhone) when the view is NOT created with Interface Builder?

link|flag
I think this question belongs to StackOverflow, especially stackoverflow.com/questions/4468643/… – Lenny222 Dec 17 at 9:30
You're right. I realized that too late. Sorry. – Emmanuel Dec 17 at 14:07

2 Answers

up vote 0 down vote accepted

If I understand the question correctly, you'll still have your model and controller classes. Your view, which normally would come from Interface Builder, is now being constructed in the controller. I like to call the pattern M/VC, where the view and controller are the same, but the model is still separated.

link|flag
Thanks you for your answer. I've got some thinking to do :-) – Emmanuel Dec 17 at 14:07

The MVC framework you're most likely using in the programming language Objective-C is either Cocoa or Cocoa Touch.

In Cocoa Touch, for instance, you'll write subclasses of UIView and subclasses of UIViewController. Those classes have concerns and functions that are specific to their functionality either as a view or as a controller.

There's more flexibility (and therefore less formal structure) around the "M" part of the MVC framework. Could be you'll use Core Data or some wrapper classes around SQLite or some entirely custom-built data manager object.

link|flag

Your Answer

 
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.