Ios6 [UICollectionViewCell imageCell]:发送到实例的选择器无法识别

Ios6 [UICollectionViewCell imageCell]:发送到实例的选择器无法识别,ios6,selector,uicollectionviewcell,Ios6,Selector,Uicollectionviewcell,我用这个标题读了所有的问题。FavoritosViewController.m我有: - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { favcolCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"fav"

我用这个标题读了所有的问题。FavoritosViewController.m我有:

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
favcolCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"fav" forIndexPath:indexPath];
[[cell imageCell]setImage:[UIImage imageNamed:[arrayimages objectAtIndex:indexPath.item]]];
return cell;
}
    @synthesize imageCell;
关于favcolCell.h,我有:

@property (retain, nonatomic) IBOutlet UIImageView *imageCell;
在favcolCell.m上,我有:

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
favcolCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"fav" forIndexPath:indexPath];
[[cell imageCell]setImage:[UIImage imageNamed:[arrayimages objectAtIndex:indexPath.item]]];
return cell;
}
    @synthesize imageCell;

我错过了什么

编辑:

解决方案:正确注册班级。

我错过了这个:

[self.collectionView registerClass:[FavoritosRestViewCell class] forCellWithReuseIdentifier:@"fav"];
在ViewDidLoad方法上。我报错了班。感谢用户的热舔。

我错过了这一点:

[self.collectionView registerClass:[FavoritosRestViewCell class] forCellWithReuseIdentifier:@"fav"];

在ViewDidLoad方法上。我报错了班。感谢用户的热舔。

对我来说,这就是解决方案

我在单元格内拍摄了一个集合视图和imageView。但我忘了在interfacestoryboard文件中设置标记

故事板->集合视图->图像视图->属性检查器->在此处设置标记


我希望它能帮助别人。

对我来说,这就是解决办法

我在单元格内拍摄了一个集合视图和imageView。但我忘了在interfacestoryboard文件中设置标记

故事板->集合视图->图像视图->属性检查器->在此处设置标记


我希望它能帮助某些人。

您知道无法识别的选择器消息的含义吗?这意味着命名类没有该名称的选择器方法。通常这是因为变量中的对象类型错误。我知道这意味着什么,我在故事板上有正确的类,我检查了很多次。你有什么建议吗?嗯,UICollectionViewCell没有一个叫做imageCell的方法。所以。。为什么我要尝试:cell.imageCell.image=[[UIImage alloc]init];它给我同样的错误?注册正确的类。您无法从该呼叫中获得favcolCell。您知道无法识别的选择器消息的含义吗?这意味着命名类没有该名称的选择器方法。通常这是因为变量中的对象类型错误。我知道这意味着什么,我在故事板上有正确的类,我检查了很多次。你有什么建议吗?嗯,UICollectionViewCell没有一个叫做imageCell的方法。所以。。为什么我要尝试:cell.imageCell.image=[[UIImage alloc]init];它给我同样的错误?注册正确的类。你不会从那个电话里得到一个favcolCell。