所以我有一个 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/