ios - uiscrollview Storyboard中的 uitableview

标签 ios iphone objective-c uitableview uiscrollview

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

相关文章:

ios - 通常如何管理从远程数据库的加载? (概念上)

ios - 如何在边缘附近滚动的情况下将 View 拖动到 UIScrollView 内?

ios - 提交到应用商店时出现 UIRequiredDeviceCapabilities 错误

ios - Facebook 错误 Invalid_access token

javascript - iPhone 中的调用自动化

iphone - Reactive Cocoa reduce block 永远不会被调用

objective-c - 在来自 Delphi XE2 Datasnap Server 的 Xcode 中处理 TDataSet 结果

ios - iOS NSURLConnection字典或数组

objective-c - 如何切割 UIView 内容?

ios - 在Xcode 5中具有NSMutableSet错误的NSMutableArray在Xcode 4中可以正常编译