Matt
Matt

Reputation: 2843

reloadData for a Table View in a View Controller

Hello I have a view controller that loads from an xib i created. It has two toolbars and a table view in that.

I add this too the header file in the ViewController

@interface FilterViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {

When I do

[self.tableView reloadData] 

It does throws up an error and does not build.

Upvotes: 0

Views: 1780

Answers (1)

chrissr
chrissr

Reputation: 9911

Just making your UIViewController conform to UITableViewDataSource and UITableViewDelegate does not automatically give you a tableView reference.

You need to create a tableView IBOutlet and connect it in Interface Builder.

Also, why not just inherit UITableViewController instead of a UIViewController?

Upvotes: 2

Related Questions