This is my code as for now, which is wrong. I am not getting the viewDidLoad due to the changing of the view.
UITableView *tableView = [[UITableView alloc] init];
tableViewController = [[TableViewController alloc] init];
tableViewController.view = tableView;
tableViewController.title = @"test";
tableView.delegate = self;
tableView.dataSource = self;
What I really need is to change the tableViewController‘s view’s delegate and datasource to my self.
The problem is that I can’t do it for some reason.
Something like that would have been great:
tableViewController = [[TableViewController alloc] init];
tableViewController.title = @"test";
tableViewController.view.delegate = self;
tableViewController.view.dataSource = self;
But for some reason I can’t set tableViewController‘s view property’s delegate nor datasource.
Any idea why?
Thanks
Make sure that the class you’re trying to use as the datasource has the proper protocols listed and delegate methods implemented.
Then you should be able to do something like.