IOS-使用uistepper在特定索引处添加单元格
我正在UITableView中显示带有复选框按钮的动态数据。当用户选择复选框按钮时,它将在其下方显示UIStepper。我不知道如何实现这一点,我所需要的是在下面的url中提到。 我刚刚在UITableView中显示了数据,如下面代码中所述。我不知道如何实现这一点,当用户选中复选框时,我是否应该在每个索引下添加单元格,或者我应该遵循其他一些好方法IOS-使用uistepper在特定索引处添加单元格,ios,objective-c,uitableview,autolayout,storyboard,Ios,Objective C,Uitableview,Autolayout,Storyboard,我正在UITableView中显示带有复选框按钮的动态数据。当用户选择复选框按钮时,它将在其下方显示UIStepper。我不知道如何实现这一点,我所需要的是在下面的url中提到。 我刚刚在UITableView中显示了数据,如下面代码中所述。我不知道如何实现这一点,当用户选中复选框时,我是否应该在每个索引下添加单元格,或者我应该遵循其他一些好方法 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSI
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [getNutrients count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"NutrientCell";
UITableViewCell *nutrientCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
nutrientCell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"texture_bg.png"]];
UILabel *nutrientLabel = (UILabel*)[nutrientCell viewWithTag:1];
nutrientLabel.text = [[getNutrients objectAtIndex:indexPath.row]valueForKey:@"name"];
return nutrientCell;
}
UITableView具有插入行或节的属性。 您可以使用insertRowsAtIndexPaths:withRowAnimation: deleteRowsAtIndexPaths:WithRowsAnimation: 分别用于插入和删除行