您好,我无法在 UICollectionView 的索引路径获取自定义对象...下面是我的代码。
我正在崩溃
[玩家名字:]: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;
}