Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IOS-使用uistepper在特定索引处添加单元格_Ios_Objective C_Uitableview_Autolayout_Storyboard - Fatal编程技术网

IOS-使用uistepper在特定索引处添加单元格

IOS-使用uistepper在特定索引处添加单元格,ios,objective-c,uitableview,autolayout,storyboard,Ios,Objective C,Uitableview,Autolayout,Storyboard,我正在UITableView中显示带有复选框按钮的动态数据。当用户选择复选框按钮时,它将在其下方显示UIStepper。我不知道如何实现这一点,我所需要的是在下面的url中提到。 我刚刚在UITableView中显示了数据,如下面代码中所述。我不知道如何实现这一点,当用户选中复选框时,我是否应该在每个索引下添加单元格,或者我应该遵循其他一些好方法 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSI

我正在UITableView中显示带有复选框按钮的动态数据。当用户选择复选框按钮时,它将在其下方显示UIStepper。我不知道如何实现这一点,我所需要的是在下面的url中提到。

我刚刚在UITableView中显示了数据,如下面代码中所述。我不知道如何实现这一点,当用户选中复选框时,我是否应该在每个索引下添加单元格,或者我应该遵循其他一些好方法

- (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: 分别用于插入和删除行