Question

I have a UIScrollView that contains multiple UITableViews horizontally - all of which are created programmatically depending on the user's action.

Say I have 4 UITableViews, how do I set the datasource and delegate for each one programmatically? I understand there are tableViewX.dataSource and tableViewY.delegate methods; and I assume I set them to an NSObject that obeys the UITableViewDataSource and UITableViewDelegate protocols, but everything I try seems to do nothing to my UITableViews.

I created the NSObject from a template of the UITableViewController and changed its class type.

Was it helpful?

Solution

Ah. Figured it out. Needed to allocate and initiate the NSObject first, before setting it as the delegate and dataSource.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top