Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • What is a good name for the class that is working as data source and table view delegate? Commented Apr 18, 2013 at 11:42
  • 1
    @JohanKarlsson I often just call it the data source. It's a bit sloppy perhaps, but I combine the two often enough to know that my "data source" is an adaptation onto Apple's more restricted definition. Commented May 19, 2013 at 12:09
  • 1
    This article: objc.io/issue-1/table-views.html proposes a way to handle multiple cell types whereby you work out the cell class in the cellForPhotoAtIndexPath method of the data source, then call an appropriate factory method. Which of course is only possible if particular classes predictably occupy particular rows. Your system of view-generating categories-on-models is much more elegant in practice, I think, although it is maybe an unorthodox approach to MVC! :) Commented Jan 3, 2014 at 16:32
  • 1
    I have try to demo this pattern at github.com/yonglam/TableViewPattern. Hope it's useful for someone. Commented Jun 16, 2014 at 2:22
  • 1
    I'll vote a definitive no for the dynamic selector approach. It is very dangerous as the issues only manifest at run time. There's no automated way to make sure that the given selector exists and that it typed correctly and this kind of approach will fall apart eventually and is a nightmare to maintain. The other approach, however, is very clever. Commented Oct 1, 2014 at 20:09