[英]Thread 1: EXEC_BAD_ACCESS (code=1) when dismissing view controller with collection
我已經直接在庫的github頁面( https://github.com/lxcid/LXReorderableCollectionViewFlowLayout/issues/43 )上發布了此問題,但我想我會在這里得到更多的了解。
我已經實現了如下庫:
LXReorderableCollectionViewFlowLayout *layout = [[LXReorderableCollectionViewFlowLayout alloc] init];
[collection setCollectionViewLayout:layout];
其中collection是我手動選擇的UIViewController內部的UICollectionView。 拖放和重新排序可以與itemAtIndexPath:fromIndexPath willMoveToIndexPath:toIndexPath函數一起正常使用。
但是,一旦我用以下方法解雇了視圖控制器:
[self dismissViewControllerAnimated:YES completion:nil];
我被線程1擊中:EXEC_BAD_ACCESS(code = 1)錯誤。
錯誤發生在這里:
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
並且bt顯示:
frame #0: 0x019130b2 libobjc.A.dylib`objc_msgSend + 14
frame #1: 0x01bab735 CoreFoundation`-[NSSet makeObjectsPerformSelector:withObject:] + 277
frame #2: 0x0087f902 UIKit`-[UIGestureRecognizer dealloc] + 127
frame #3: 0x008952a5 UIKit`-[UILongPressGestureRecognizer dealloc] + 174
其他人遇到的類似問題( https://github.com/lxcid/LXReorderableCollectionViewFlowLayout/issues/32 )也有響應:
之所以發生崩潰,是因為從布局視圖中刪除布局時,從不刪除在視圖視圖上設置的手勢識別器。 因此,當發生手勢時,識別器會嘗試在目前已取消分配的布局上調用委托方法gestureRecognizerShouldBegin:。
但是,如果是同一問題,我不確定這意味着什么或如何解決。
任何幫助是極大的贊賞。
我仍然不確定是什么原因造成的,但是我通過更改為github源而不是使用cocoapods解決了這個問題。 我的cocoapod版本是0.1.0.beta1(我從https://www.cocoacontrols.com/controls/lxreorderablecollectionviewflowlayout獲得 ),我猜它已經過時了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.