如何在故事板中连接原型单元? [英] How to connect a prototype cell in a storyboard?

查看:252
本文介绍了如何在故事板中连接原型单元?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在故事板中创建了一个tableview,以及一个自定义原型单元。我已经在故事板中设置了单元格标识符,并且我正在尝试将其出列并且正在获取:

I've created a tableview in the storyboard, and a custom prototype cell. I've set the cell identifier in the storyboard, and am trying to dequeue it and am getting:

无法使用标识符TTEntry对单元格进行出列 - 必须注册一个笔尖或标识符的类或连接故事板中的原型单元格

unable to dequeue a cell with identifier TTEntry - must register a nib or a class for the identifier or connect a prototype cell in a storyboard

我无法在故事板TableCell属性中看到任何其他内容来链接它。我只是不知道消息是什么。

I can't see anything else in the storyboard TableCell properties to link it with. I just don't know what the message is getting at.

有人能指出我正确的方向吗?

Can someone point me in the right direction?

谢谢!

Screwtape。

Screwtape.

推荐答案

来自故事板:


  1. 在属性检查器中设置重用标识符

  2. 在Jignesh Agola提到的故事板中添加CustomCell类

从代码(如柠檬青梅柚发布):

From code (like lemon lime pomelo posted) :

[self.tableView registerClass:<Your UITableViewCell subclass> forCellReuseIdentifier:<Your identifier>]

这篇关于如何在故事板中连接原型单元?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆