Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7188

App crashes when tableview has some rows and it number of rows becomes zero in a section during reload

$
0
0

I have got a tableview it has 6 sections. each section can have either one row or zero.

When some operation is done I'll reload the tableview but sometimes the app crashes.

Any suggestions on this please

 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 2. The number of rows contained in an existing section after the update (0) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000107b6502e __exceptionPreprocess + 350
    1   libobjc.A.dylib                     0x00000001079ddb20 objc_exception_throw + 48
    2   CoreFoundation                      0x0000000107b64da8 +[NSException raise:format:arguments:] + 88
    3   Foundation                          0x0000000107405b61 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
    4   UIKitCore                           0x000000010e805734 -[UITableView _Bug_Detected_In_Client_Of_UITableView_Invalid_Number_Of_Rows_In_Section:] + 193
    5   UIKitCore                           0x000000010e804fed -[UITableView _endCellAnimationsWithContext:] + 16657
    6   UIKitCore                           0x000000010e81f783 -[UITableView _updateSections:withUpdateAction:rowAnimation:headerFooterOnly:usingPresentationValues:] + 787
    7   UIKitCore                           0x000000010e81fd99 -[UITableView reloadSections:withRowAnimation:] + 185
    8   My BT Gotham                        0x0000000104999437 -[HomeViewController setSalesCardDataOnUI] + 279
    9   My BT Gotham                        0x000000010499d776 __64-[HomeViewController configureCellForRowAtIndexPath:forDisplay:]_block_invoke + 134
    10  libdispatch.dylib                   0x000000010b6b9dd4 _dispatch_call_block_and_release + 12
    11  libdispatch.dylib                   0x000000010b6bad48 _dispatch_client_callout + 8
    12  libdispatch.dylib                   0x000000010b6c8de6 _dispatch_main_queue_callback_4CF + 1500
    13  CoreFoundation                      0x0000000107ac7df9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    14  CoreFoundation                      0x0000000107ac2a59 __CFRunLoopRun + 2329
    15  CoreFoundation                      0x0000000107ac1e16 CFRunLoopRunSpecific + 438
    16  GraphicsServices                    0x00000001122c7bb0 GSEventRunModal + 65
    17  UIKitCore                           0x000000010e63ab48 UIApplicationMain + 1621
    18  My BT Gotham                        0x00000001048ca010 main + 112
    19  libdyld.dylib                       0x000000010b742c25 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Viewing all articles
Browse latest Browse all 7188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>