自定义单元崩溃

发布于 2024-10-13 23:07:43 字数 3474 浏览 1 评论 0原文

我正在使用 CustomCell 表格视图,下载数据并绑定它。当我点击多次时出现此错误。

[NSCFString numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x1bd170
Sat Jan 22 12:03:26 unknown Fridge[535] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x1bd170'
 *** Call stack at first throw:
 (
  0   CoreFoundation                      0x314d0987 __exceptionPreprocess + 114
  1   libobjc.A.dylib                     0x319a149d objc_exception_throw + 24
  2   CoreFoundation                      0x314d2133 -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
  3   CoreFoundation                      0x31479aa9 ___forwarding___ + 508
  4   CoreFoundation                      0x31479860 _CF_forwarding_prep_0 + 48
  5   UIKit                               0x339023fb -[UITableViewRowData(UITableViewRowDataPrivate) _updateNumSections] + 66
  6   UIKit                               0x3390235b -[UITableViewRowData invalidateAllSections] + 50
  7   UIKit                               0x33902111 -[UITableView(_UITableViewPrivate) _updateRowData] + 64
  8   UIKit                               0x33902069 -[UITableView noteNumberOfRowsChanged] + 64
  9   UIKit                               0x33901bff -[UITableView reloadData] + 582
  10  UIKit                               0x33904a0b -[UITableView _reloadDataIfNeeded] + 50
  11  UIKit                               0x33904e63 -[UITableView layoutSubviews] + 18
  12  UIKit                               0x338b10cf -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 26
  13  CoreFoundation                      0x3146ebbf -[NSObject(NSObject) performSelector:withObject:] + 22
  14  QuartzCore                          0x30a6c685 -[CALayer layoutSublayers] + 120
  15  QuartzCore                          0x30a6c43d CALayerLayoutIfNeeded + 184
  16  QuartzCore                          0x30a6656d _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 212
  17  QuartzCore                          0x30a66383 _ZN2CA11Transaction6commitEv + 190
  18  QuartzCore                          0x30a89f9d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 52
  19  CoreFoundation                      0x31460c59 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
  20  CoreFoundation                      0x31460acd __CFRunLoopDoObservers + 412
  21  CoreFoundation                      0x314580cb __CFRunLoopRun + 854
  22  CoreFoundation                      0x31457c87 CFRunLoopRunSpecific + 230
  23  CoreFoundation                      0x31457b8f CFRunLoopRunInMode + 58
  24  GraphicsServices                    0x35d664ab GSEventRunModal + 114
  25  GraphicsServices                    0x35d66557 GSEventRun + 62
  26  UIKit                               0x338d5329 -[UIApplication _run] + 412
  27  UIKit                               0x338d2e93 UIApplicationMain + 670
  28  Fridge                              0x00002a7f main + 70
  29  Fridge                              0x00002a34 start + 40
 )
Sat Jan 22 12:03:26 unknown UIKitApplication:com.sdi.Fridge[0xa6da][535] <Notice>: terminate called after throwing an instance of 'NSException'






**Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayer numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x184250'**

谢谢

I am using CustomCell tableview, download data and binding it.When i tap multiple time am getting this error.

[NSCFString numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x1bd170
Sat Jan 22 12:03:26 unknown Fridge[535] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x1bd170'
 *** Call stack at first throw:
 (
  0   CoreFoundation                      0x314d0987 __exceptionPreprocess + 114
  1   libobjc.A.dylib                     0x319a149d objc_exception_throw + 24
  2   CoreFoundation                      0x314d2133 -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
  3   CoreFoundation                      0x31479aa9 ___forwarding___ + 508
  4   CoreFoundation                      0x31479860 _CF_forwarding_prep_0 + 48
  5   UIKit                               0x339023fb -[UITableViewRowData(UITableViewRowDataPrivate) _updateNumSections] + 66
  6   UIKit                               0x3390235b -[UITableViewRowData invalidateAllSections] + 50
  7   UIKit                               0x33902111 -[UITableView(_UITableViewPrivate) _updateRowData] + 64
  8   UIKit                               0x33902069 -[UITableView noteNumberOfRowsChanged] + 64
  9   UIKit                               0x33901bff -[UITableView reloadData] + 582
  10  UIKit                               0x33904a0b -[UITableView _reloadDataIfNeeded] + 50
  11  UIKit                               0x33904e63 -[UITableView layoutSubviews] + 18
  12  UIKit                               0x338b10cf -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 26
  13  CoreFoundation                      0x3146ebbf -[NSObject(NSObject) performSelector:withObject:] + 22
  14  QuartzCore                          0x30a6c685 -[CALayer layoutSublayers] + 120
  15  QuartzCore                          0x30a6c43d CALayerLayoutIfNeeded + 184
  16  QuartzCore                          0x30a6656d _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 212
  17  QuartzCore                          0x30a66383 _ZN2CA11Transaction6commitEv + 190
  18  QuartzCore                          0x30a89f9d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 52
  19  CoreFoundation                      0x31460c59 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
  20  CoreFoundation                      0x31460acd __CFRunLoopDoObservers + 412
  21  CoreFoundation                      0x314580cb __CFRunLoopRun + 854
  22  CoreFoundation                      0x31457c87 CFRunLoopRunSpecific + 230
  23  CoreFoundation                      0x31457b8f CFRunLoopRunInMode + 58
  24  GraphicsServices                    0x35d664ab GSEventRunModal + 114
  25  GraphicsServices                    0x35d66557 GSEventRun + 62
  26  UIKit                               0x338d5329 -[UIApplication _run] + 412
  27  UIKit                               0x338d2e93 UIApplicationMain + 670
  28  Fridge                              0x00002a7f main + 70
  29  Fridge                              0x00002a34 start + 40
 )
Sat Jan 22 12:03:26 unknown UIKitApplication:com.sdi.Fridge[0xa6da][535] <Notice>: terminate called after throwing an instance of 'NSException'






**Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayer numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x184250'**

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乙白 2024-10-20 23:07:43

感谢您详细了解您的问题,但唯一重要的部分是它

-[NSCFString numberOfSectionsInTableView:]: unrecognized selector 

告诉您正在调用 numberOfSectionsInTableView: 上的 NSCFString 方法

,这似乎是错误的,

因此请检查在您的代码中调用该方法的位置

在您的情况下也不需要其余的。

编辑:

您是否在委托方法表视图中释放了自定义单元格。如果是,则使用 autorelease 代替。

Thanks for the detail view of your problem but the only important part is this

-[NSCFString numberOfSectionsInTableView:]: unrecognized selector 

It tells that you are calling the method numberOfSectionsInTableView: on a NSCFString

which is seem to be wrong

so check where is that method called in your code

And also the rest is not require in your case.

Edit:

did you release your custom cell in the delegate method tableview. if yes than use autorelease instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文