开发者

reloadData for a Table View in a View Controller

开发者 https://www.devze.com 2023-01-08 00:57 出处:网络
Hello I have a view controller that loads from an xib i created.It has two toolbars and a table view in that.

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 ViewControl开发者_JS百科ler

@interface FilterViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {

When I do

[self.tableView reloadData] 

It does throws up an error and does not build.


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消