UITableView reload data

后端 未结 7 1327
鱼传尺愫
鱼传尺愫 2020-12-01 00:27

i\'m making a navigation based application for iphone.

one of my view controllers looks like this:

@interface NewComputerViewController : UIViewContr         


        
7条回答
  •  孤独总比滥情好
    2020-12-01 01:06

    Make sure you are setting datasource and delegate for tableView.

    tableView.delegate = self;
    tableView.dataSource = self;
    

    Make sure the proper delegate and datasource method is implemented in the controller.

    In the loadStuff method, call:

    [tableView reloadData];
    

    In swift, the same:

    tableView.delegate = self
    tableView.dataSource = self
    tableView.reloadData()
    

提交回复
热议问题