0

您好,我无法在 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;

}
4

1 回答 1

0

当我意外收到此错误时,我通常会返回 IB,选择导致崩溃的对象,并调查 Connections Inspector。通常,问题似乎是不正确的引用插座或发送的事件。

这可能是由于performSelector:@selector(dismissModal:)在被调用者不存在的地方调用引起的。

于 2013-02-05T18:28:58.477 回答