【发布时间】:2014-06-28 00:11:49
【问题描述】:
我已经实现了UICollectionViewCell 的一个子类SPCell,我用它来在我的UICollectionViewController 中创建单元格。现在,当我收集一个单元格时,为了对其进行处理,我收到了一个警告Incompatible pointer types initializing 'SPCell *' with an expression of type 'UICollectionViewCell *'
这是一个例子。我的自定义单元格包含一个图像,我想更改它的 alpha 值。但是在我分配单元格的行中,我收到了这个警告。
- (void)collectionView:(UICollectionView *)collectionView didHighlightItemAtIndexPath:(NSIndexPath *)indexPath;{
SPCell *cell = [self.collectionView cellForItemAtIndexPath:indexPath];
cell.thumbnail.alpha=0.6;
}
提前致谢。
【问题讨论】:
-
SPCell *cell = (SPCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
标签: ios objective-c uicollectionviewcell incomplete-type