Tuesday, 27 August 2013

TableView inside ViewController but keeping inheritance /subclass system

TableView inside ViewController but keeping inheritance /subclass system

Here is the problem - the left image display how my Tableview was before
filling the whole screen and the right the new one, that is a standard
ViewController with a TableView inside. The trouble is in the new one I
need to add a outlet to the tableview, set it as tableview/source delegate
and then copy all the code from my TableviewControllers (which uses a
series of subclasses for reusability). If I copy over all this to the
ViewController then I end up copying a lot of code, and ruining my system
of inheritance, perfect way to introduce bugs, and create a lot of extra
work
Is there a way around this?
In the left image the controller class follows a hierarchy of inheritance
ThisTBC > abstractTBC ->UITableViewController
In the right image, the controller is a simple ViewController. But if I
want to control the TableView from this controller can I do it without
having to copying all the code from the left controller (ThisTBC >
abstractTBC) into the right ViewController

No comments:

Post a Comment