I'm taking the plunge into iPhone development after about two years working with django. As I've done tutorials and read documentation, one of the things that strikes me as inconvenient about the various libraries used in iPhone development is the amount of repetition required when creating user input forms for data models.
I know of two conventional approaches to user input form creation:
Create a group of UITextFields in Interface Builder that correspond with the properties on the model class and link them up to corresponding IBOutlets on a custom form controller.
Create a form view programatically with UITextFields in tables with a custom form view controller class. The class keeps a list of names that correspond to the properties of a model in an array, and then iterate over the array to create UITextFields for each table cell. Use special casing to determine which model attribute is being iterated over, and use that information to create table cells with corresponding UILabels and UITextFields.*
Of the two, only the first seems practical for iterative development, the second is painfully verbose and extremely difficult (for me) to read. With the introspective capabilities of Objective-C it seems like it would be possible to write code that accepted a model class as an argument and generate a form controller (and perhaps even a form view) from that information at runtime.
So I have three questions:
Are there conventional alternate approaches to creating form views and controllers for models other than the two I've listed above? I'm not loving either approach I've listed there.
Is automatic generation of form controllers / views at runtime feasible in Objective-C, or am I just barking up the wrong tree?
Has such automatic generation been attempted or accomplished already? (a little googling turned up nothing)
*My main reference for this comes from Example #6 in Chapter 9: Navigation Controllers and Table Views of Apress' "Beginning iPhone 3 Development"