CustomLayout icon indicating copy to clipboard operation
CustomLayout copied to clipboard

生成LayoutAttributes时创建indexPath不要用indexPathWithIndex。crash!

Open 451222664 opened this issue 6 years ago • 2 comments

生成LayoutAttributes时创建indexPath用indexPathWithIndex,会导致在swift中的collectionView返回组头viewForSupplementaryElementOfKind这个方法取indexPath.section时崩溃。改成 NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:i]; 就好了

451222664 avatar Jul 30 '19 08:07 451222664

@451222664 谢谢 没有用 swift 试过 ,最近会改写成 swift

nobodyJee avatar Aug 01 '19 14:08 nobodyJee

跟Swift没关系,你在你demo的viewForSupplementaryElementOfKind方法打印 indexPath.section 也会崩

451222664 avatar Aug 01 '19 14:08 451222664