0
你好,我無法在UICollectionView的索引路徑上獲取自定義對象... 下面是我的代碼。UICollectionView cellForRow崩潰
我正在崩潰
[球員姓:]:unrecognized selector sent to instance
有什麼建議?
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
BenchCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CollectionCell forIndexPath:indexPath];
[cell setFrame:CGRectMake(0, 4, 120, 50)];
Player*homeBenchPlayer = [[self homeBench]objectAtIndex:indexPath.row];
cell.playerName.text = homeBenchPlayer.firstName;
cell.playerPosition .text = homeBenchPlayer.position;
cell.playerPicture.image = [ UIImage imageWithData:homeBenchPlayer.picture];
return cell;
}
您沒有從您的homebench數組中獲得播放器類對象... – Lefteris
是的我是,我在播放該對象並確實是一個播放器類對象。 – Luke
在哪一行發生崩潰? – Lefteris