나는이 응용 프로그램을 작성 중이며이 오류가 발생합니다. 내가 어떻게 고칠 지 확신 할 수 없다. 고맙습니다.헤더 파일에 뭔가를 추가해야합니까?
오류가 선언되지 않은 식별자 'collectionView'
헤더 파일을 가져오고있다.
헤더 : 오류가
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath*)indexPath
{
if(shareEnabled){
//determine the selected items by using the indexPath
NSString *selectedPhotos = [tagImages[indexPath.section] objectAtIndex:indexPath];
//add selected image into the array
[selectedPhotos addObject:selectedPhotos];
}
}
덕분에 많이들
나도 같은하는 .m 파일에 collectionView 여러 번 사용을 발생#import <UIKit/UIKit.h>
NSMutableData *content;
@interface AMCollectionViewController : UICollectionViewController
@property (weak, nonatomic) IBOutlet UIBarButtonItem *tagButton;
- (IBAction)tagButtonTouched:(id)sender;
@end
구현
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return 50;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
static NSString *identifier [email protected]"Cell";
AMCollectionViewCell *cell = (AMCollectionViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
int imageNumber = indexPath.row % 10;
cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"imageicon%d.jpg",imageNumber]];
cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"imageBorder.jpg"]];
return cell;
}
무엇이 오류입니까? – rmaddy
헤더 (.h)를 구현 파일 (.m)에'# 가져 오기 '하시겠습니까? –
'편집'을 사용하여 질문에 오류를 추가하십시오. – Popeye