我已经以编程方式创建了集合视图,我在集合视图单元格中添加了.xib文件,如下所示
$("p").text(function() {
return $(this).text().replace(/(#)/g, '');
});
但是它显示了像
这样的异常- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
static NSString * const reuseIdentifier = @"CollectionCell";
CollectionCell *cell = (CollectionCell *)[collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CollectionCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.itemImage.image = [UIImage imageNamed:images[indexPath.row]];
cell.itemLabel.text = [NSString stringWithFormat:@"Item Index %ld",(long)indexPath.row];
return cell;
}
我在这做错了什么?请帮帮我。