Ios 种类的SupplementElement的LayoutAttribute没有UICollectionViewLayoutAttribute实例?

Ios 种类的SupplementElement的LayoutAttribute没有UICollectionViewLayoutAttribute实例?,ios,xcode,uicollectionview,Ios,Xcode,Uicollectionview,委托方法 [self.collectionView registerClass:[CollectionViewFooter class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"CollectionViewFooter"]; 按断点检查,到达直线时出错 [self.collectionView性能更新:^{集合视图的补充视图通常与集合视图的

委托方法

[self.collectionView registerClass:[CollectionViewFooter class]
            forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"CollectionViewFooter"];
按断点检查,到达直线时出错
[self.collectionView性能更新:^{

集合视图的补充视图通常与集合视图的页眉或页脚视图相关,如果您使用它们,它们可能有问题。关于页脚视图问题,当我滚动到页脚附近的底部时,会发生错误。您是否真的在UICollectionView补充视图中返回了页脚视图页脚委托方法的视图?-(UICollectionReusableView*)collectionView:(UICollectionView*)collectionView for SupplmentalElementOfKind:(NSString*)kind atIndexPath:(NSIndexPath*)indexPath我假设在使用-(void)registerClass:(Class)设置集合视图时,必须注册以使用补充视图viewClass for Supplmentary ViewOfKind:(NSString*)elementKind with ReuseIdentifier:(NSString*)标识符请参见我更新的问题,其中有register方法和delegate方法。我仍在尝试找出我做错了哪一部分。如果条件假设为[kind IseQualString:…]而不是[kind isEqual:…]?但更重要的是,您是否需要if()检查?dequeReusableSupplementaryView接受一个“种类”参数,因此它将返回匹配的种类,不是吗?
[self.collectionView registerClass:[CollectionViewFooter class]
            forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"CollectionViewFooter"];
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
    //declare the reusable view of header and footer
    UICollectionReusableView *reusableview = nil;

    CollectionViewFooter *footer=nil;


    if([kind isEqual:UICollectionElementKindSectionFooter])
    {
        footer = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"CollectionViewFooter" forIndexPath:indexPath];

        //attach the footer to reusable view
        reusableview = footer;
    }


    return reusableview;
}