Код представляет собой простой вид коллекции с кучей изображений Я запустил его, и Xcode не спорит ни о чем, кроме симулятора отображается черный экран после запуска приложения.black window in simulator -collection view
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return recipePhotos.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
static NSString *identifier [email protected]"Cell";
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
// Configure the cell
UIImageView * recipeImageView = (UIImageView *)[cell viewWithTag:100];
recipeImageView.image=[UIImage imageNamed:[recipePhotos objectAtIndex:indexPath.row]];
return cell;
}
UIImage * recImage = [UIImage imageNamed: [recipePhotos objectAtIndex: indexPath.row]]; –
сначала проверьте, не является ли это ненужным –
, вы зарегистрировали ячейку в viewdidload? –