插座无法连接到CollectionView单元中的重复内容 [英] Outlets cannot be connected to repeating content in CollectionView Cells

查看:50
本文介绍了插座无法连接到CollectionView单元中的重复内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在已声明为的UICollectionViewCell中连接UILabel时

When I am trying to connect a UILabel in a UICollectionViewCell that has been declared as

@property (nonatomic, weak) IBOutlet UILabel *Title;

它表明:

插座无法连接到重复内容.

Outlet cannot be connected to repeating content.

我已经进行了一些搜索,发现我需要使用UIView和UICollectionView之间的插座的某种连接.但是我不知道该怎么做.那么如何建立这样的连接,以便可以访问UICollectionViewCell中的UILabel?

I have done some search and find out that I need to use some kinds of connection of the outlet between UIView and the UICollectionView. But I do not understand what to do exactly. So how could I make such a connection so that UILabel in the UICollectionViewCell can be accessed?

推荐答案

您需要将 UICollectionViewCell 子类化,该类应在集合视图中使用.子类是您将在其中添加插座的地方.

You need to subclass UICollectionViewCell which you should use in your collection view. The subclass is where you will add the outlet.

这篇关于插座无法连接到CollectionView单元中的重复内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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