5

Good day,

I am unable to replicate a crash but several of my live users are experiencing a crash. A report of the crash as downloaded from crashlytics is below. Can someone please help? Its happening to users on iOS12.

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x220ee4ec4 __exceptionPreprocess
1  libobjc.A.dylib                0x2200b5a40 objc_exception_throw
2  CoreFoundation                 0x220dfab3c +[_CFXNotificationTokenRegistration keyCallbacks]
3  Foundation                     0x2218e91d0 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4  UIKitCore                      0x24d55ed28 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:]
5  UIKitCore                      0x24d562e14 -[UICollectionView _updateVisibleCellsNow:]
6  UIKitCore                      0x24d567eb4 -[UICollectionView layoutSubviews]
7  UIKitCore                      0x24e13b96c -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
8  QuartzCore                     0x2254e1b74 -[CALayer layoutSublayers]
9  QuartzCore                     0x2254e6b2c CA::Layer::layout_if_needed(CA::Transaction*)
10 UIKitCore                      0x24e126e58 -[UIView(Hierarchy) layoutBelowIfNeeded]
11 UIKitCore                      0x24e12da08 +[UIView(Animation) performWithoutAnimation:]
12 UIKitCore                      0x24debd174 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:]
13 UIKitCore                      0x24debd4bc -[UITableView _createPreparedCellForGlobalRow:willDisplay:]
14 UIKitCore                      0x24de88b94 -[UITableView _updateVisibleCellsNow:isRecursive:]
15 UIKitCore                      0x24de894fc -[UITableView _updateVisibleCellsNow:isRecursive:]
16 UIKitCore                      0x24dea6a80 -[UITableView layoutSubviews]
17 UIKitCore                      0x24e13b96c -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
18 QuartzCore                     0x2254e1b74 -[CALayer layoutSublayers]
19 QuartzCore                     0x2254e6b2c CA::Layer::layout_if_needed(CA::Transaction*)
20 QuartzCore                     0x22544544c CA::Context::commit_transaction(CA::Transaction*)
21 QuartzCore                     0x225473d7c CA::Transaction::commit()
22 QuartzCore                     0x225474be4 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
23 CoreFoundation                 0x220e747cc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
24 CoreFoundation                 0x220e6f460 __CFRunLoopDoObservers
25 CoreFoundation                 0x220e6fa00 __CFRunLoopRun
26 CoreFoundation                 0x220e6f1f0 CFRunLoopRunSpecific
27 GraphicsServices               0x2230e8584 GSEventRunModal
28 UIKitCore                      0x24dc934c0 UIApplicationMain
29 Psychic Txt                    0x1020cd03c main (main.m:14)
30 libdyld.dylib                  0x22092ebb4 start
Waris Ali
  • 522
  • 3
  • 14
  • what is the cell behavior when added to the collection view? can user edit rows (insert/delete?) – giorashc Jan 22 '19 at 10:59
  • Rows are added or deleted automatically when the app receives notifications handled through listener conforming to a XMPP server. The rows works fine when I test the app . I have ran 100s of tests but not able to replicate this a single time. – Waris Ali Jan 22 '19 at 11:02
  • hmm.. NSInternalInconsistencyException regarding collection views on _createPreparedCellForItemAtIndexPath usually (not 100% sure if there are other cases) are thrown when trying to insert/delete row but not updating the datasource correctly. Can you post how you update the datasource on insert/delete? – giorashc Jan 22 '19 at 12:53

1 Answers1

-1

You probably have a synchronization issue with your data and propagating the insertions and deletions to the collectionview. You need to make sure that your datasource is not being modified while insert/delete cells is making changes to the collectionview.

That means that if your listener wants to update your data, you need to make sure that the previous changes have been applied. You could do this using a semaphore.

MartinM
  • 832
  • 6
  • 12