在我的iPhone应用程序,我有这样的委托方法:手动执行表重装
- (void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region
{
//lots of logic here, but in the end I do a
[self.tableView reloadData];
}
出于测试目的,我想手动加载表虚拟数据。为此,我有一个UIButton,触发
-(IBAction)reloadTable:(id)sender{
[self.tableView reloadData];
}
不知何故,没有任何反应,当我按下按钮时。我希望
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
被调用,但它不是。
我推理的洞在哪里?
是tableview数据源/委托集?你的数据源中是否有新的数据?您的reloadTable IBAction只是重新加载表,它不会将更多数据添加到数据源? – CW0007007 2015-02-11 14:49:14
是,设置了源代码和委托。但可能没有新的数据。如果我有更多信息,我会回到这里。我认为reloaddata会经历整个tableview委托方法,不管(新)数据是否存在( – Sjakelien 2015-02-11 15:36:45
),但是如果没有新数据,你期望看到 – CW0007007 2015-02-12 07:19:27