子类化UICollectionViewFlowLayout有时会在iOS6上崩溃

子类化UICollectionViewFlowLayout有时会在iOS6上崩溃,ios,objective-c,ios7,ios6,uicollectionview,Ios,Objective C,Ios7,Ios6,Uicollectionview,我想要一个UICollectionView,其中flowlayout方向是水平的。我已经实现了targetContentOffsetForProposedContentOffset:withScrollingVelocity:方法,以便在表格中滚动时始终将视图“捕捉”到集合视图中的单元格 我对UICollectionViewFlowLayout进行了如下子类化 (使用此处实现的方法的代码:) 这些方法有时会导致错误: [self.collectionView scrollToItemAtInde

我想要一个UICollectionView,其中flowlayout方向是水平的。我已经实现了targetContentOffsetForProposedContentOffset:withScrollingVelocity:方法,以便在表格中滚动时始终将视图“捕捉”到集合视图中的单元格

我对UICollectionViewFlowLayout进行了如下子类化 (使用此处实现的方法的代码:)

这些方法有时会导致错误:

[self.collectionView scrollToItemAtIndexPath:newIndexPath atScrollPosition:UICollectionViewScrollPositionRight animated:YES];

我的直觉没有问题。它们在iOS7上工作得很好,大多数情况下在iOS6上也是如此

在我的子类实现中是否有明显的遗漏导致了这种情况

多谢各位

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICollectionViewUpdateItem action]: unrecognized selector sent to instance
[self.collectionView scrollToItemAtIndexPath:newIndexPath atScrollPosition:UICollectionViewScrollPositionRight animated:YES];
[self.collectionView deleteItemsAtIndexPaths:indexPaths];