Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios -[UICollectionViewData LayoutAttributes中的断言失败,该属性适用于种类:atIndexPath:]_Ios_Objective C_Iphone_Ios8_Ios7.1 - Fatal编程技术网

Ios -[UICollectionViewData LayoutAttributes中的断言失败,该属性适用于种类:atIndexPath:]

Ios -[UICollectionViewData LayoutAttributes中的断言失败,该属性适用于种类:atIndexPath:],ios,objective-c,iphone,ios8,ios7.1,Ios,Objective C,Iphone,Ios8,Ios7.1,我在集合视图中遇到此错误。 我已经实现了这个方法,并返回最后一节的页脚 - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section { if (section == LAST_SECTION_INDEX) {

我在集合视图中遇到此错误。 我已经实现了这个方法,并返回最后一节的页脚

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section
{
    if (section == LAST_SECTION_INDEX) 
    {
        return CGSizeMake(self.view.width, 50);
    }

    return CGSizeZero;
}
viewforsupplementalelementofkind
方法中,我实现了这样的
CollectionViewFooter
UICollectionReusableView
类的一个子类

- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
{
    CollectionViewFooter *footer = [self.collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:FooterIdentifier forIndexPath:indexPath];
      return footer;
}
当集合视图重新加载时,它将崩溃并导致此错误

-[UICollectionViewData LayoutAttributes中的断言失败,该属性适用于种类:atIndexPath:]

我被困在这里了。有人能帮忙吗


谢谢。

dequeueReusableSupplementaryViewOfKind:kind