<p>I'm in a hypothetical situation in which I need to list students in a school. I have one table view controller that has several sections, representing a school. Each school has subsequent students. Now, I have the requirement to give the user the capability to view all students for a particular school by clicking on the school name in a top level view of my navigation controller.</p>

<p>The question here is, do I branch out my current "StudentsViewController" and add complex logic in order to allow it to display an individual School's students, or would you experts recommend a new class to handle that table?</p>

<p>The tradeoffs are rather straight forward in that I can indeed probably put everything in one view controller at the cost of some confusing/complex logic. On the other hand, there will be a great deal of repeated code if I write another controller that handles an individual school's students.</p>

<p>What do the experts recommend on this one?</p>

I think it would depend on the model you are using to hold your data.
Lets say you have an array of arrays,
(array of schools, each school holds an array of students.)
In this case, I would stick with one tableController.
The logic doesn't have to be hairy if your model design is simple, and I think it would be cleaner and "more correct" than multiple subclasses in this case.
Don't forget anywhere the system passes you an
NSIndexPath
you have the section and row numbers. (
School
and
Student
)
indexPath.section
and
indexPath.row