ios - 如何使用 "Outlets cannot be connected to repeating content"解决此错误?

标签 ios swift uitableview pftableviewcell

我正在尝试将 Storyboard 原型(prototype)单元格中的标签连接到我的 View Controller 。每次我这样做时,我都会收到一条错误消息,提示“Outlets cannot be connected to repeating content”。我不知道为什么要这样做,因为我不知道我在哪里重复内容,但我在下面提供了一张图片。只是为了避免混淆“TOP cell: user post”的绿色注释, socket 连接到 View Controller 的顶部,您可以在其中看到用户、消息和时间。我只想创建从原型(prototype)单元格到 View Controller 的导出,而不会出现此错误。我希望这是足够的信息。

enter image description here

最佳答案

这个标签属于 UITableView 单元格。并且您将 socket 连接到 Controller ,所以问题发生了。

你应该这样做:

创建一个 TableView 单元格子类并将其设置为原型(prototype)的类。将 socket 添加到该类并连接它们。

关于ios - 如何使用 "Outlets cannot be connected to repeating content"解决此错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33427451/

相关文章:

swift - Xcode 9 在 Ctrl+拖动时显示菜单

Swift - Tableviewcell删除图标自定义

ios - 如何为UITableViewCell的文本Label和detailTextLabel设置约束

swift - 在一个 View Controller 中将具有多个 TableView 的自定义单元格出队

ios - 在后台重新加载 UITableView 的数据

ios - 更改 JSQMessagesViewController 的框架

ios - UICollectionView 是否随着 Xcode 7、swift 2.0 更改了协议(protocol)?

Swift:带有 "complex"数据的 pList

ios - 如何从该 segue 或目标 View Controller 访问执行 segue 的源 View ?

objective-c - 将 NSMutableDictionary 中的所有值连接为 int、NSInteger 和 NSString