lukescott / DraggableCollectionView

Extension for the UICollectionView and UICollectionViewLayout that allows a user to move items with drag and drop. --- HELP WANTED --- Looking for maintainer and help with the experimental branch.
MIT License
549 stars 175 forks source link

Crash when using adding section headers #11

Closed rtsao closed 11 years ago

rtsao commented 11 years ago

I am running the FlowLayoutDemo, but when I try adding section headers and pick up a cell to move, I get a crash as soon as I release the item or drag it over another.

2013-07-22 12:14:04.596 FlowLayoutDemo[99484:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: <_UICollectionViewItemKey: 0xdc82d70> Type = SV Kind = UICollectionElementKindSectionHeader IndexPath = <NSIndexPath 0xdc82c20> 2 indexes [0, 0])'
lukescott commented 11 years ago

Can you provide the backtrace? Screenshot will do.

rtsao commented 11 years ago

screen shot 2013-07-22 at 3 04 40 pm

lukescott commented 11 years ago

You're missing your collectionView:viewForSupplementaryElementOfKind:atIndexPath: delegate call, or you're not returning a view for UICollectionElementKindSectionHeader in it. If you do have one and the code looks right, check to make sure the Storyboard has the same Identifier applied and the storyboard is saved. Might have to do a Build -> Clean.

rtsao commented 11 years ago

Thanks, that seems to have fixed my problem!