我已经在我的视图中添加了一个UICollectionView
。我已经实现了下面的方法。
我得到错误:
“NSInvalidArgumentException”,原因:'-[NSIndexPath reuseIdentifier]:无法识别的选择器发送到实例”
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return 1;
}
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *identifier = @"CellID";
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
UIImageView *imageView = (UIImageView *)[cell viewWithTag:10];
imageView.image = [UIImage imageNamed:@"V.jpg"];
}
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
return 1;
}