Outlets cannot be connected to repeating content in CollectionView Cells

痴心易碎 提交于 2021-02-16 15:09:45

问题


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

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

It shows that:

Outlet cannot be connected to repeating content.

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?


回答1:


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




回答2:


i too faced this issue, solution: From viewcontroller kindly remove the IBoutlet of colllectionviewcell . the issue mentions the invalid of your IBOutlet. so remove all subclass which has multi-outlet(invalids) and reconnect it.



来源:https://stackoverflow.com/questions/41811306/outlets-cannot-be-connected-to-repeating-content-in-collectionview-cells

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!