gpt4 book ai didi

ios - uiscrollview Storyboard中的 uitableview

转载 作者:行者123 更新时间:2023-12-01 16:46:13 26 4
gpt4 key购买 nike

所以我有一个 UIScrollView在 Storyboard和 UITableView在 Storyboard中也是如此。关键是我想在 ScrollView 中放几个 UITableView 的实例。 .但我得到一个错误
unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard
那么如何解决这个问题呢?

提前致谢!

行!这是我的代码:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"DayCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

[self configerCell:cell atIndexPath:indexPath];

return cell;
}

我在 Storyboard中给了一个单元格一个标识符......

这就是我将 UITableView 添加到 UIScrollView 的方式:
UITableViewController *tableView = [[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped];
[self.mainScroll addSubview:tableView.view];

最佳答案

我认为您的 tableview 单元格需要一个标识符。尝试单击表格 View 单元格,然后在属性检查器下有一个名为 Identifier 的字段.检查那个!

关于ios - uiscrollview Storyboard中的 uitableview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19768979/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com