Reputation: 38162
Problem Statement :== I have an application wherein I need to draw different cells at different table view controllers based on the kind of data my controller is holding. I have like 17 odd cell types.
My Solution :== I am thinking of writing 17 different classes each returning a particular type of cell. Now my controller classes will call a cellSelectionController along with the data it have which in turn, based on data and kind of controller, will instantiate the specific cell class and return the UITableViewCell object.
Is the correct way of implementing this scenario or something better than can be done keeping all design issues in mind?
Upvotes: 0
Views: 203
Reputation: 22305
I don't know that it's a better solution, but Matt Gallagher has some good stuff about heterogenous table cells in a recent post: UITableView construction, drawing and management (revisited)
Upvotes: 1