Reputation: 4277
I am working on an iOS application and i need your help guys !
My home page is a UIView, in this UIView i have a UIImageView,..., and also a UITableView.
I create a UITableViewController class and i need to associate this class to my UITableView.
How can i do ?
Best regards !
Upvotes: 0
Views: 337
Reputation: 1916
Why do u want to create a UITableViewController for it. Simply create a UIViewController and append the UITableViewControllerDelegate and UITableViewDataSource to it to take control of your UITableView:
SomeClass : UIViewController <UITableViewControllerDelegate, UITableViewControllerDataSource>
in the viewDidLoad you have to assign the delegate/datasource of the tableview to your UIViewController:
self.tableView.delegate = self;
self.tableView.datasource = self;
Upvotes: 1
Reputation: 1567
If we suppose your "homepage" is RootViewController Class (.h/.m/.xib), you will extend this class to have UITableViewDelegate and UITableViewDataSource. In your definition of UITableView you will set the delegate and the datasource to RootViewController and add the required methods for cell rendering.
No UITableViewController required.
Upvotes: 1