Connect UITableView DataSource/Delegate to base UIViewController class

ios, objective-c, xcode

Solution

Xcode will type-check the objects you attempt to connect. So there are two pre-requisites:

- An object of your class must "be present" in the storyboard, which usually involves setting a custom class on a UIViewController in the inspector

- The class of your object must declare that it conforms to the correct protocols before you make the connections.

If those two criteria are met, you should be able to ctrl-click on the UITableViewController, and drag from these connections to an object of your class, either in the storyboard or in the list of objects on the left.

EDIT: I have added a picture of setting the delegates via the two-step method of ctrl-clicking the table view, then dragging from the popover to the protocol-conforming view controller. This technique works with both the list view on the left as well as the graphical representations in the workspace.

Problem

I'm attempting to connect my UITableView's DataSource and Delegate to my ViewController's base class via the storyboard. I Was able to connect my IBActions and IBOutlets easily, but this is proving trickier. Is the correct method to instantiate the delegate/datasource methods then call the same methods on super? TIA

Original source