ios - `tableView:heightForHeaderInSection:` 调用了未实现它的委托(delegate)

标签 ios objective-c cocoa-touch uitableview uikit

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SomeClassNameController tableView:heightForHeaderInSection:]: unrecognized selector sent to instance 0x1805f1f0'

除非我误解了文档,否则这应该是不可能的。如果 tableView:heightForHeaderInSection: 没有在委托(delegate)中实现,它应该使用存储在 sectionHeaderHeight 中的任何值。在任何情况下,它都不应在未实现它的委托(delegate)上调用 tableView:heightForHeaderInSection:

这是正确的还是我实际上误解了文档?

编辑:按要求堆栈跟踪。

Last Exception Backtrace:
0   CoreFoundation                      0x30443e83 __exceptionPreprocess + 131
1   libobjc.A.dylib                     0x3aadf6c7 _objc_exception_throw + 39
2   CoreFoundation                      0x304477b7 -[NSObject(NSObject) doesNotRecognizeSelector:] + 203
3   CoreFoundation                      0x30445f4d ___forwarding___ + 353
4   CoreFoundation                      0x30394dc8 __CF_forwarding_prep_0 + 24
5   UIKit                               0x32cabfff -[UISectionRowData heightForHeaderInSection:canGuess:] + 123
6   UIKit                               0x32cabf2b -[UITableViewRowData rectForHeaderInSection:heightCanBeGuessed:] + 391
7   UIKit                               0x32dc83b3 -[_UITableViewUpdateSupport(Private) _setupAnimationsForExistingHeadersAndFooters] + 1603
8   UIKit                               0x32dc37db -[_UITableViewUpdateSupport _setupAnimations] + 187
9   UIKit                               0x32dc328b -[UITableView _updateWithItems:updateSupport:] + 1363
10  UIKit                               0x32d9b397 -[UITableView _endCellAnimationsWithContext:] + 8019
11  appname                             0x000704a9 -[SomeClassNameView layoutSubviews] (SomeClassNameView.m:47)
12  UIKit                               0x32bc8353 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 347
13  QuartzCore                          0x3284e943 -[CALayer layoutSublayers] + 143
14  QuartzCore                          0x3284a167 CA::Layer::layout_if_needed(CA::Transaction*) + 351
15  QuartzCore                          0x32849ff9 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 17
16  QuartzCore                          0x32849a0d CA::Context::commit_transaction(CA::Transaction*) + 229
17  QuartzCore                          0x3284981f CA::Transaction::commit() + 315
18  QuartzCore                          0x3284354d CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 57
19  CoreFoundation                      0x3040ef69 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 21
20  CoreFoundation                      0x3040c8f7 __CFRunLoopDoObservers + 287
21  CoreFoundation                      0x3040cc43 __CFRunLoopRun + 739
22  CoreFoundation                      0x30377471 _CFRunLoopRunSpecific + 525
23  CoreFoundation                      0x30377253 _CFRunLoopRunInMode + 107
24  GraphicsServices                    0x350782eb _GSEventRunModal + 139
25  UIKit                               0x32c2c845 _UIApplicationMain + 1137
26  appname                             0x00386767 main (main.m:32)
27  appname                             0x00020e48 start + 40

最佳答案

您是否有机会使用 Apptimize 框架进行 A/B 测试?将它引入我的项目会导致它导致 UITableView 委托(delegate)响应检查停止工作,并使您描述的 UITableView 问题发生。如果我删除框架,它就会停止。

关于ios - `tableView:heightForHeaderInSection:` 调用了未实现它的委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21630253/

相关文章:

.net - ios 文件从 mac/pc 共享/同步到设备

objective-c - 如何在选择器方法中发送两个参数?

ios - UIButtons 上的 UISwipeGestureRecognizer

ios - 打开表情符号键盘时自定义 UITextField 卡住应用程序?

ios - 如何在swift中用args调用函数 objective-c

ios - 在使用 monogame 的 iOS App 中集成 Admob

iphone - iOS 开发 : Adding Greystripe ads to my app via AdWhirl is causing a crash

ios - 我可以使用 Xcode 7 创建自动扩展应用程序吗?

iphone - 当 CGRect 是实例变量时如何获得对 CGRect 元素的赋值访问

iOS 需要一个表达式