我把文本框在表中的每一个细胞。 和编辑文本字段后,一个EditingDidEnd
事件将触发。 在hanlding这一事件的方法我尝试使用
[XXXUITableViewController.tableView reloadData];
但它不工作(委托方法不叫)。
如果我尝试reloadData
以某种方式一样hanlding Tapgesture,它工作得很好。 我可以用anthoer方式让我的应用程序的工作,但它是更好地了解为什么reloadData不能正常工作。 任何想法,非常感谢。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"ParCellID";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
for(UIView * old in cell.contentView.subviews){
[old removeFromSuperview];
}
//add a textfield in Table Cell View
ParticleConfigCellView * parCell=[[[NSBundle mainBundle] loadNibNamed:@"ParticleConfigCellView" owner:self options:nil]objectAtIndex:0];
[parCell refreshFromDataSource:[self.dataContainer.data_particleConifig objectAtIndex:indexPath.row]];
[cell.contentView addSubview:parCell];
return cell;
}
- (IBAction)nameChange:(id)sender {
[self savedata];
[self.tableView reloadData];//(not working. Table view delegate methods are not called.)
}