views:

2289

answers:

3

Hi,

How can I tell my UITableViewController to use my custom UITableView subclass for it's tableView instead of a regular UITableView?

Many thanks,

Michael

+5  A: 

Set the UITableViewController.tableView property to an instance of your custom UITableView subclass.

astar
+1  A: 

In interface builder associate the tableview class with your custom tableview in the identity inspector view

ennuikiller
+1  A: 

A UITableViewController is just a UIViewController with a UITableView instance and the viewController set as the delegate and dataSource for the table. The viewController implements stubs for those delegate methods.

You can do it yourself by having a UIViewController implement the UITableViewDataSource and UITableViewDelegate protocols. Then in the UIViewController's loadView (or viewDidLoad) method set the tableView instance's dataSource and delegate to self.

You can use your own table subclass there.

Ramin