1
내부 UICollectionView를 포함하는 방법
내 애플 때문에는 UICollectionViewSectionHeader
[UICollectionViewFlowLayout collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance.
내 대리자 메서드 내 UICollectionReusableView
내부에 있기 때문 뷰 컨트롤러가 아닌 이는의 충돌한다. UICollectionViewSectionHeader
안에 UICollectionView를 포함시키고 UICollectionView에 대한 대리자를 설정할 때 내 응용 프로그램이 손상되는 것을 방지하려면 어떻게해야합니까?
#import "HomeBannerReusableView.h"
#import "HomeBannerCell.h"
@interface HomeBannerReusableView() <UICollectionViewDelegate, UICollectionViewDataSource>
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@end
@implementation HomeBannerReusableView
- (void)awakeFromNib {
// Initialization code
[self.collectionView registerNib:[UINib nibWithNibName:@"HomeBannerCell" bundle:nil] forCellWithReuseIdentifier:@"HomeBannerCell"];
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return 1;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
HomeBannerCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeBannerCellReusableView" forIndexPath:indexPath];
return cell;
}