【问题标题】:The photoImageView outlet from the ViewController to the UIImageView is invalid. Outlets cannot be connected to repeating content从 ViewController 到 UIImageView 的 photoImageView 出口无效。插座无法连接到重复内容
【发布时间】:2018-02-04 03:25:55
【问题描述】:

我在表格视图中添加 ImageView,但在编译时出现上述错误?我需要为单元格添加类吗

【问题讨论】:

标签: ios swift uiimageview


【解决方案1】:

插座不能连接到重复的内容

您收到此错误消息是因为您在 viewController 的类中将 Outlet 分配给了单元格的 imagevView。

你不能直接给出口。

您必须创建 UITableviewCell 的子类,并且能够为任何单元格的内容提供出口。

或者您可以给特定视图添加标签,并在需要时使用标签访问视图。

【讨论】:

    【解决方案2】:

    “创建一个表格视图单元子类并将其设置为原型的类。将出口添加到该类并连接它们。现在,当您配置单元时,您可以访问出口。” More info

    【讨论】:

      猜你喜欢
      • 2021-04-08
      • 2021-03-15
      • 1970-01-01
      • 2020-07-03
      • 1970-01-01
      • 2014-12-21
      • 2015-10-11
      • 2015-01-24
      相关资源
      最近更新 更多