、、、objectivec
2014-07-21 18:02:38.259 Sections[2962:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'must pass a class of kind UITableViewCell'
*** First throw call stack:
(
0 CoreFoundation 0x017375e4 exceptionPreprocess + 180
1 libobjc.A.dylib 0x014ba8b6 objc_exception_throw + 44
2 CoreFoundation 0x017373bb +[NSException raise:format:] + 139
3 UIKit 0x00314e08 -[UITableView registerClass:forCellReuseIdentifier:] + 247
4 Sections 0x000030eb -[BIDViewController searchDisplayController:didLoadSearchResultsTableView:] + 171
5 UIKit 0x005cc0b4 -[UISearchDisplayController searchResultsTableView] + 446
6 UIKit 0x005cd5f4 -[UISearchDisplayController _containerView] + 1031
7 UIKit 0x005c7563 -[UISearchDisplayController setActive:animated:] + 9462
8 UIKit 0x005cad4f -[UISearchDisplayController searchBarTextDidBeginEditing:] + 298
9 UIKit 0x004f52c9 -[UISearchBar(UISearchBarStatic) _searchFieldBeginEditing] + 113
10 libobjc.A.dylib 0x014cc81f -[NSObject performSelector:withObject:] + 70
11 UIKit 0x0022ec8c -[UIApplication sendAction:to:from:forEvent:] + 108
12 UIKit 0x0022ec18 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
13 UIKit 0x003266d9 -[UIControl sendAction:to:forEvent:] + 66
14 UIKit 0x00326a9c -[UIControl _sendActionsForEvents:withEvent:] + 577
15 UIKit 0x0091254e -[UITextField willAttachFieldEditor:] + 685
16 UIKit 0x0032c4d5 -[UIFieldEditor becomeFieldEditorForView:] + 927
17 UIKit 0x00909643 -[UITextField _becomeFirstResponder] + 160
18 UIKit 0x004f841a -[UISearchBarTextField _becomeFirstResponder] + 98
19 UIKit 0x00386585 -[UIResponder becomeFirstResponder] + 400
20 UIKit 0x00289d0b -[UIView(Hierarchy) becomeFirstResponder] + 114
21 UIKit 0x009090e3 -[UITextField becomeFirstResponder] + 51
22 UIKit 0x005ae651 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary] + 135
23 UIKit 0x005b0ba2 -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) oneFingerTap:] + 2640
24 UIKit 0x005a4f8c _UIGestureRecognizerSendActions + 230
25 UIKit 0x005a3c00 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 383
26 UIKit 0x005a566d -[UIGestureRecognizer _delayedUpdateGesture] + 60
27 UIKit 0x005a8bcd ___UIGestureRecognizerUpdate_block_invoke + 57
28 UIKit 0x005a8b4e _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317
29 UIKit 0x0059f248 _UIGestureRecognizerUpdate + 199
30 UIKit 0x0026bd4a -[UIWindow _sendGesturesForEvent:] + 1291
31 UIKit 0x0026cc6a -[UIWindow sendEvent:] + 1030
32 UIKit 0x00240a36 -[UIApplication sendEvent:] + 242
33 UIKit 0x0022ad9f _UIApplicationHandleEventQueue + 11421
34 CoreFoundation 0x016c08af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15
35 CoreFoundation 0x016c023b __CFRunLoopDoSources0 + 235
36 CoreFoundation 0x016dd30e __CFRunLoopRun + 910
37 CoreFoundation 0x016dcb33 CFRunLoopRunSpecific + 467
38 CoreFoundation 0x016dc94b CFRunLoopRunInMode + 123
39 GraphicsServices 0x036d89d7 GSEventRunModal + 192
40 GraphicsServices 0x036d87fe GSEventRun + 104
41 UIKit 0x0022d94b UIApplicationMain + 1225
42 Sections 0x0000399d main + 141
43 libdyld.dylib 0x01d75701 start + 1
44 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
、、、
如上所示,错误提示,使用的是XCODE5 无法根据错误提示找到出错行,网上有的方法试过不可以。希望知道的同学告知下。谢谢!
在 Xcode 的 Breakpoint Navigator 里面添加一个异常断点(Add Exception Breakpoint),然后将断点条件设置成
Exception: Object-C
,这样就能在异常抛出之前断下来,你就可以查看当时的调用栈。注意最好在快要执行到出问题代码的时候才打开这个断点,否则会不断被各种异常干扰。