I'm trying to create a custom cell for my table. This custom cell must have a collection horizontal view inside. I did the configuration of the collection view with the delegate and datasource and add the necessary methods. Now I am getting the following error:
"reason: 'invalid nib registered for identifier (DeviceLostPhotoCell) - nib must contain exactly one top level object which must be a UITableViewCell instance'"
this is my code:
- (void)awakeFromNib {
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section; {
return 5;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath;{
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"DeviceImageCell" forIndexPath:indexPath];
return cell;
}
this red square this with the identifier "DeviceImageCell" what should be the cell of my collection view.
Aucun commentaire:
Enregistrer un commentaire