PagingView icon indicating copy to clipboard operation
PagingView copied to clipboard

Crash PagingView.swift line 388

Open Ewg777 opened this issue 6 years ago • 3 comments

Version PagingView (0.5.1) SIGTRAP 0x00000000019d4b84

Crashed: com.apple.main-thread
0  libswiftCore.dylib             0x19d4b84 globalinit_33_FD9A49A256BEB6AF7C48013347ADC3BA_func6 + 100612
1  PagingView                     0x14467f8 PagingView.reloadContentView() (PagingView.swift:388)
2  PagingView                     0x1447288 PagingView.layoutSubviews() (PagingView.swift:439)
3  PagingView                     0x1447634 @objc PagingView.layoutSubviews() (PagingView.swift)
4  UIKit                          0x2102f483 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1224
5  QuartzCore                     0x1ec87cb7 -[CALayer layoutSublayers] + 126
6  QuartzCore                     0x1ec7bd77 CA::Layer::layout_if_needed(CA::Transaction*) + 354
7  UIKit                          0x210431a7 -[UIView(Hierarchy) layoutBelowIfNeeded] + 1176
8  MyApp              0x1cdde4 specialized APagingBaseCell.setData(_:page:) (APagingBaseCell.swift:81)
9  MyApp              0x3719bc specialized AListView.collectionView(_:cellForItemAt:) (AListView.swift:154)
10 MyApp              0x3705a0 @objc AListView.collectionView(_:cellForItemAt:) (AListView.swift)
11 UIKit                          0x218b3851 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 420
12 UIKit                          0x210935e1 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 42
13 UIKit                          0x210917f7 -[UICollectionView _updateVisibleCellsNow:] + 4076
14 UIKit                          0x2108c3d7 -[UICollectionView layoutSubviews] + 398
15 UIKit                          0x2102f483 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1224
16 QuartzCore                     0x1ec87cb7 -[CALayer layoutSublayers] + 126
17 QuartzCore                     0x1ec7bd77 CA::Layer::layout_if_needed(CA::Transaction*) + 354
18 QuartzCore                     0x1ec7bc05 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
19 QuartzCore                     0x1ec0a839 CA::Context::commit_transaction(CA::Transaction*) + 320
20 QuartzCore                     0x1ec28fdb CA::Transaction::commit() + 578
21 QuartzCore                     0x1ec29b2f CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 162
22 CoreFoundation                 0x1bdbb803 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
23 CoreFoundation                 0x1bdb9a55 __CFRunLoopDoObservers + 282
24 CoreFoundation                 0x1bdba017 __CFRunLoopRun + 1358
25 CoreFoundation                 0x1bd0d1af CFRunLoopRunSpecific + 470
26 CoreFoundation                 0x1bd0cfd1 CFRunLoopRunInMode + 104
27 GraphicsServices               0x1d4b7b41 GSEventRunModal + 80
28 UIKit                          0x21095a53 UIApplicationMain + 150
29 MyApp              0x110ae4 main (A.swift:44)
30 libdyld.dylib                  0x1b4fa4eb start + 2

@KyoheiG3

Ewg777 avatar Apr 19 '18 12:04 Ewg777

Could you tell me Xcode version, iOS version and what have done?

KyoheiG3 avatar Apr 20 '18 01:04 KyoheiG3

@KyoheiG3 xcode Version 9.2 (9C40b). All ios versions https://imgur.com/TBVdjWQ The crash occurs when I'm updating the data in my DataManager (line APagingBaseCell.setData(_:page:) (APagingBaseCell.swift:81)) before PagingView.reloadData() get called. Did it help?

Ewg777 avatar Apr 20 '18 06:04 Ewg777

Please check the value returned by the delegate functions below and the value of IndexPath you are trying to access.

func pagingView(_ pagingView: PagingView, numberOfItemsInSection section: Int) -> Int
@objc optional func numberOfSectionsInPagingView(_ pagingView: PagingView) -> Int

That crash error is because IndexPath is out of range. PagingView.swift#L388

KyoheiG3 avatar Apr 25 '18 02:04 KyoheiG3