How to generically handle class objects that differ only by initialized properties?
I like the idea of abstracting CellControllers in a heterogeneous UITableView [as suggested by Matt Gallagher][1]. However in the case of typical push-detail-view behavior, I find myself creating nearly-identical variants of `LinkRowCellController` that differ only by the detail view controllers' `init` methods -- `init:`, `initWithBook:`, `initWithMagazine:`, `initWithHelpURLString:andTopic:`, etc.

It seems like I could change the designated initializer to take a dictionary of property keys and initial arguments and have the `LinkRowCellController` `initWithProperties:` method set up the properties using `setValueForKey:` on the pairs passed in.

That solution seems to give up compile-time checking of the `init` arguments. What is the best practice in Objective-C for heterogeneous inits in otherwise homogeneous code?

  [1]: http://cocoawithlove.com/2008/12/heterogeneous-cells-in.html

How to generically handle class objects that differ only by initialized properties?
===

I like the idea of abstracting CellControllers in a heterogeneous UITableView [as suggested by Matt Gallagher][1]. However in the case of typical push-detail-view behavior, I find myself creating nearly-identical variants of `LinkRowCellController` that differ only by the detail view controllers' `init` methods -- `init:`, `initWithBook:`, `initWithMagazine:`, `initWithHelpURLString:andTopic:`, etc.

It seems like I could change the designated initializer to take a dictionary of property keys and initial arguments and have the `LinkRowCellController` `initWithProperties:` method set up the properties using `setValueForKey:` on the pairs passed in.

That solution seems to give up compile-time checking of the `init` arguments. What is the best practice in Objective-C for heterogeneous inits in otherwise homogeneous code?

  [1]: http://cocoawithlove.com/2008/12/heterogeneous-cells-in.html
