3

我正在使用CustomCell tableview,下载数据并绑定它。当我多次点击时,我得到了这个错误。

[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'**

谢谢

4

1 回答 1

2

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

-[NSCFString numberOfSectionsInTableView:]: unrecognized selector 

它告诉您正在调用该numberOfSectionsInTableView:方法NSCFString

这似乎是错误的

所以检查你的代码中调用的方法在哪里

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

编辑:

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

于 2011-01-22T06:43:33.297 回答