问题
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