简体   繁体   English

将标签连接到UITableViewCell

[英]Connecting label to UITableViewCell

I've created several tables in the past but I believe it's something with the way I'm doing it that Xcode doesn't like this time. 过去我已经创建了几个表,但是我相信Xcode这次不喜欢这种方式。

I have several xib files with a UIView inside. 我有几个带有UIView的xib文件。 These together creates a slideview like snapchat. 这些共同构成了幻灯片,如手套。

In one of these xib files I have a UIView. 在这些xib文件之一中,我有一个UIView。 In this I have a UITableView and a UITableViewCell. 在这里,我有一个UITableView和一个UITableViewCell。 I have set up a prototype cell with an identifier "cell". 我已经建立了一个带有标识符“ cell”的原型单元。 I've set up the delegate and dataSource as I usually do. 我已经像平常一样设置了委托和数据源。

I made a UITableViewCell class and set up the class for the prototype cell. 我制作了一个UITableViewCell类,并为原型单元设置了该类。

Here's where the trouble is: I wanna connect my labels on the cell to the UITableViewCell class and make IBOutlets. 问题出在这里:我想将单元格上的标签连接到UITableViewCell类并制作IBOutlets。 But Xcode doesn't let me do it. 但是Xcode不允许我这样做。 It simply doesn't connect them. 它根本不连接它们。

Any suggestions on why I can't do it or if there's a way around?? 关于为什么我不能做到或是否有解决办法的任何建议?

Change class of your UITableViewCell to your custom class in xib. 将UITableViewCell的类更改为xib中的自定义类。 (in utilities section,there is option called custom class) (在实用程序部分,有一个称为自定义类的选项)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM