-3

I get this issue when i run my xcode Project. i will start the project and the simulator will load but as soon as it loads up the app i am making it crashes. This is the error code :Thread 1: Exception: "unable to dequeue a cell with identifier ChecklistItem - must register a nib or a class for the identifier or connect a prototype cell in a storyboard" and says this in the terminal:

2020-07-24 18:11:06.757164+0100 Checklists[983:49709] *** Assertion failure in -[UITableView _dequeueReusableCellWithIdentifier:forIndexPath:usingPresentationValues:], /Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3920.31.102/UITableView.m:8724
2020-07-24 18:11:06.771044+0100 Checklists[983:49709] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier ChecklistItem - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010b93ae6e __exceptionPreprocess + 350
    1   libobjc.A.dylib                     0x000000010a23a9b2 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010b93abe8 +[NSException raise:format:arguments:] + 88
    3   Foundation                          0x0000000109c1bbd2 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
    4   UIKitCore                           0x000000010e53d6be -[UITableView _dequeueReusableCellWithIdentifier:forIndexPath:usingPresentationValues:] + 1332
    5   UIKitCore                           0x000000010e53d156 -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] + 91
    6   Checklists                          0x0000000109979a38 $s10Checklists23ChecklistViewControllerC05tableC0_12cellForRowAtSo07UITableC4CellCSo0jC0C_10Foundation9IndexPathVtF + 264
    7   Checklists                          0x0000000109979b25 $s10Checklists23ChecklistViewControllerC05tableC0_12cellForRowAtSo07UITableC4CellCSo0jC0C_10Foundation9IndexPathVtFTo + 165
    8   UIKitCore                           0x000000010e556e96 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 867
    9   UIKitCore                           0x000000010e520522 -[UITableView _updateVisibleCellsNow:] + 3010
    10  UIKitCore                           0x000000010e54024e -[UITableView layoutSubviews] + 194
    11  UIKitCore                           0x000000010e8465f4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2478
    12  QuartzCore                          0x00000001103b1260 -[CALayer layoutSublayers] + 255
    13  QuartzCore                          0x00000001103b73eb _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 523
    14  QuartzCore                          0x00000001103c2a8a _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 80
    15  QuartzCore                          0x000000011030ba7c _ZN2CA7Context18commit_transactionEPNS_11TransactionEd + 324
    16  QuartzCore                          0x000000011033f467 _ZN2CA11Transaction6commitEv + 649
    17  UIKitCore                           0x000000010e3566c3 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 81
    18  CoreFoundation                      0x000000010b89eabc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    19  CoreFoundation                      0x000000010b89e1b3 __CFRunLoopDoBlocks + 195
    20  CoreFoundation                      0x000000010b898fa3 __CFRunLoopRun + 995
    21  CoreFoundation                      0x000000010b8988a4 CFRunLoopRunSpecific + 404
    22  GraphicsServices                    0x0000000114910bbe GSEventRunModal + 139
    23  UIKitCore                           0x000000010e33e968 UIApplicationMain + 1605
    24  Checklists                          0x000000010997aa1b main + 75
    25  libdyld.dylib                       0x000000010c8581fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 
Eduard
  • 3,395
  • 8
  • 37
  • 62

1 Answers1

2

Based on the error, you did not register the cell when setting up the tableview.

Check the documentation:

tableView.register(UITableViewCell.self, forCellReuseIdentifier: "DefaultCell")

Or

tableView.register(UINib(nibName: "yourNib", bundle: nil), forCellReuseIdentifier: "CellFromNib")

Just fill in the proper values for cell, nibName, identifier, etc... Depending on which method you're using

And here is a link to a guide if you need a bit more info: link

lavta3
  • 200
  • 1
  • 12