自定义单元崩溃
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢您详细了解您的问题,但唯一重要的部分是它
告诉您正在调用
numberOfSectionsInTableView:
上的NSCFString
方法,这似乎是错误的,
因此请检查在您的代码中调用该方法的位置
在您的情况下也不需要其余的。
编辑:
您是否在委托方法表视图中释放了自定义单元格。如果是,则使用 autorelease 代替。
Thanks for the detail view of your problem but the only important part is this
It tells that you are calling the method
numberOfSectionsInTableView:
on aNSCFString
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.