小编jdn*_*ada的帖子

更新UITableView上单元格中的子视图

我正在使用Storyboard在iPad 6.0中开发一个应用程序.

我先解释一下我的目标.我正在尝试使用2个UITableViewControllers来实现Master-Detail(类似SplitViewController)的View Controller.

第一个UITableView("Master"),让我们调用这个HeaderTableView,顾名思义,列出Headers为...

...第二个UITableView("Detail"),我们称之为EncodingTableView,它包含一个以编程方式更改的CustomTableViewCell(每个单元格中包含的子视图可能是UITextField,UIButton或UISwitch).

请参阅EncodingTableView.m

- (void)updateEncodingFields:(NSArray *)uiViewList
{
    // Add logic for determining the kind of UIView to display in self.tableView

    // Finally, notify that a change in data has been made (not working)
    [self.tableView reloadData];
}
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        {
            NSString *encodingFieldsTableId = @"encodingFieldsTableId";

            CustomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:encodingFieldsTableId];

            if (cell == nil) {
                cell = [[CustomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:encodingFieldsTableId];
            }
            // Change text in textView property of …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c uitableview ipad

1
推荐指数
1
解决办法
3829
查看次数

标签 统计

ipad ×1

objective-c ×1

uitableview ×1

xcode ×1