3
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *CellIdentifier = @"cell";
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[CustomCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
[cell addButtons:buttonsArray];
}
[cell renderCell:[self.dataArray objectAtIndex:indexPath.row]];
return cell;
}
在viewDidAppear buttonArray改變,所以我想更新我的細胞新buttonArray。我使用[tableView reloadData]
但(cell != nil)
我不能更新不能用新數據更新單元(電池!=無)
那麼,是問題?如果單元格爲!= nil,那麼單元格顯然先前已經通過內部的if塊,因此已經添加了按鈕 - 只需使用它們即可。 – luk2302
請更新您的問題,因爲它很明顯 –
@ luk2302我更新了我的問題。你可以請現在檢查。謝謝 –