所以我也有一个UIScrollView
故事板和一个UITableView
故事板。关键是我想将它的几个实例放在滚动视图中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;
}
我在情节提要中给一个单元一个标识符...
这就是我将UITableView添加到UIScrollView的方法:
UITableViewController *tableView = [[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped];
[self.mainScroll addSubview:tableView.view];
我认为您的tableview单元格需要一个标识符。尝试单击表格视图单元格,然后在属性检查器下方有一个名为的字段Identifier
。检查一下!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句