【发布时间】:2015-08-24 17:31:13
【问题描述】:
我使用 xib (MyCustomCell.xib) 创建了一个自定义 UICollectionViewCell(我们称之为 MyCustomCell),我想创建一个 MyCustomCell 的子类(我们称之为 MyCustomCell2)。 MyCustomCell2 (MyCustomCell) 的父级有一个名为 titleLabel 的 IBOutlet。但是,即使我这样做了,MyCustomCell2 的 titleLabel 也总是返回 nil
self.collectionView.
registerClass(MyCustomCell2.self, forCellWithReuseIdentifier: cellIdentifier);
在 viewDidLoad 中
和
let cell = collectionView.
dequeueReusableCellWithReuseIdentifier(cellIdentifier, forIndexPath: indexPath) as! MyCustomCell2;
在 cellForRowAtIndexPath 中
有什么想法吗?
【问题讨论】:
标签: swift xib uicollectionviewcell