tableview

时间:2016-10-07 22:46:06

标签: swift xcode uitableview debugging sigabrt

我最近在我的应用中添加了一个UITableView,并收到了这些错误。

我在互联网上到处寻找,但我真的希望有人可以帮助我。

DEBUGER -

2016-10-08 02:34:41.404 SharkMate [15408:428153]配置默认应用。 2016-10-08 02:34:41.440:启用FIRInstanceID AppDelegate代理,将调配app委托远程通知处理程序。要禁用将“FirebaseAppDelegateProxyEnabled”添加到Info.plist并将其设置为NO 2016-10-08 02:34:41.442 SharkMate [15408:] Firebase Analytics v.3402000启动 2016-10-08 02:34:41.476 SharkMate [15408:]要启用调试日志记录,请设置以下应用程序参数:-FIRAnalyticsDebugEnabled 2016-10-08 02:34:41.502 SharkMate [15408:]自动成功创建Firebase Analytics App委托代理。要禁用代理,请在Info.plist中将标志FirebaseAppDelegateProxyEnabled设置为NO 2016-10-08 02:34:41.551 SharkMate [15408:] Firebase Analytics已启用 2016-10-08 02:34:41.575 SharkMate [15408:428153] *断言失败 - [UITableView _configureCellForDisplay:forIndexPath:],/ BuildRoot / Library / Cache / com.apple.xbs / Source / UIKit_Sim / UIKit -3512.60.7 / UITableView.m:7971 2016-10-08 02:34:41.579 SharkMate [15408:428153] * 由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'UITableView(; layer =; contentOffset:{0,-64}; contentSize :{414,308}>)无法从其dataSource()获取单元格 ***第一次抛出调用堆栈: (     0 CoreFoundation 0x000000010f8bcd85 exceptionPreprocess + 165     1 libobjc.A.dylib 0x00000001119f1deb objc_exception_throw + 48     2 CoreFoundation 0x000000010f8bcbea + [NSException raise:format:arguments:] + 106     3基金会0x000000010fd91d5a - [NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198     4 UIKit 0x000000011058f4b1 - [UITableView _configureCellForDisplay:forIndexPath:] + 225     5 UIKit 0x000000011059b51e - [UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 808     6 UIKit 0x000000011059b62c - [UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74     7 UIKit 0x000000011056fd4f - [UITableView _updateVisibleCellsNow:isRecursive:] + 2996     8 UIKit 0x00000001105a4686 - [UITableView _performWithCachedTraitCollection:] + 92     9 UIKit 0x000000011058b344 - [UITableView layoutSubviews] + 224     10 UIKit 0x00000001104f8980 - [UIView(CALayerDelegate)layoutSublayersOfLayer:] + 703     11 QuartzCore 0x0000000115599c00 - [CALayer layoutSublayers] + 146     12 QuartzCore 0x000000011558e08e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366     13 QuartzCore 0x000000011558df0c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24     14 QuartzCore 0x00000001155823c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277     15 QuartzCore 0x00000001155b0086 _ZN2CA11Transaction6commitEv + 486     16 QuartzCore 0x00000001155b07f8 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92     17 CoreFoundation 0x000000010f7e1c37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23     18 CoreFoundation 0x000000010f7e1ba7 __CFRunLoopDoObservers + 391     19 CoreFoundation 0x000000010f7d711c CFRunLoopRunSpecific + 524     20 UIKit 0x0000000110438f21 - [UIApplication _run] + 402     21 UIKit 0x000000011043df09 UIApplicationMain + 171     22 SharkMate 0x000000010dde9962 main + 114     23 libdyld.dylib 0x00000001124c992d start + 1     24 ??? 0x0000000000000001 0x0 + 1 ) libc ++ abi.dylib:以NSException类型的未捕获异常终止

1 个答案:

答案 0 :(得分:0)

错误信号非常表格没有注册单元格

将单元格注册到tableview,如下所示

self.tableView.register(UINib.init(nibName: "CustomCellClassName", bundle: Bundle.main), forCellReuseIdentifier:"cell")

确保在nib中设置单元格标识符