LXReorderableCollectionViewFlowLayout icon indicating copy to clipboard operation
LXReorderableCollectionViewFlowLayout copied to clipboard

EXC_BAD_ACCESS when layout is changed on collection view

Open rakeshta opened this issue 11 years ago • 3 comments

Steps to simulate:

  1. Set collection view the LXReoderableCollectionViewFlowLayout
  2. After the collection view is visible on screen change the layout using [UICollectionView setCollectionViewLayout:<new layout instance. (Any layout class will work.)
  3. Perform any gesture on the collection view. (long press or swipe will work)
  4. EXC_BAD_ACCESS

rakeshta avatar May 15 '13 10:05 rakeshta

The crash occurs because the gesture recognizers that have been setup on the collection view are never removed when the layout is removed from the collection view. So when a gesture occurs, the recognizer tries to call the delegate method gestureRecognizerShouldBegin: on the layout which has by now been deallocated.

rakeshta avatar May 15 '13 10:05 rakeshta

@rakeshta Wow... this helped me out a LOT! Thank you!

sibljon avatar Jun 17 '13 04:06 sibljon

do you can hand a pull request to fix this?

mRs- avatar Jul 10 '13 14:07 mRs-