Xcode5 如何调试 快速定位出错行

、、、objectivec
2014-07-2118:02:38.259Sections[2962:70b]***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'mustpassaclassofkindUITableViewCell'
***Firstthrowcallstack:
(
0CoreFoundation0x017375e4exceptionPreprocess+180
1libobjc.A.dylib0x014ba8b6objc_exception_throw+44
2CoreFoundation0x017373bb+[NSExceptionraise:format:]+139
3UIKit0x00314e08-[UITableViewregisterClass:forCellReuseIdentifier:]+247
4Sections0x000030eb-[BIDViewControllersearchDisplayController:didLoadSearchResultsTableView:]+171
5UIKit0x005cc0b4-[UISearchDisplayControllersearchResultsTableView]+446
6UIKit0x005cd5f4-[UISearchDisplayController_containerView]+1031
7UIKit0x005c7563-[UISearchDisplayControllersetActive:animated:]+9462
8UIKit0x005cad4f-[UISearchDisplayControllersearchBarTextDidBeginEditing:]+298
9UIKit0x004f52c9-[UISearchBar(UISearchBarStatic)_searchFieldBeginEditing]+113
10libobjc.A.dylib0x014cc81f-[NSObjectperformSelector:withObject:]+70
11UIKit0x0022ec8c-[UIApplicationsendAction:to:from:forEvent:]+108
12UIKit0x0022ec18-[UIApplicationsendAction:toTarget:fromSender:forEvent:]+61
13UIKit0x003266d9-[UIControlsendAction:to:forEvent:]+66
14UIKit0x00326a9c-[UIControl_sendActionsForEvents:withEvent:]+577
15UIKit0x0091254e-[UITextFieldwillAttachFieldEditor:]+685
16UIKit0x0032c4d5-[UIFieldEditorbecomeFieldEditorForView:]+927
17UIKit0x00909643-[UITextField_becomeFirstResponder]+160
18UIKit0x004f841a-[UISearchBarTextField_becomeFirstResponder]+98
19UIKit0x00386585-[UIResponderbecomeFirstResponder]+400
20UIKit0x00289d0b-[UIView(Hierarchy)becomeFirstResponder]+114
21UIKit0x009090e3-[UITextFieldbecomeFirstResponder]+51
22UIKit0x005ae651-[UITextInteractionAssistant(UITextInteractionAssistant_Internal)setFirstResponderIfNecessary]+135
23UIKit0x005b0ba2-[UITextInteractionAssistant(UITextInteractionAssistant_Internal)oneFingerTap:]+2640
24UIKit0x005a4f8c_UIGestureRecognizerSendActions+230
25UIKit0x005a3c00-[UIGestureRecognizer_updateGestureWithEvent:buttonEvent:]+383
26UIKit0x005a566d-[UIGestureRecognizer_delayedUpdateGesture]+60
27UIKit0x005a8bcd___UIGestureRecognizerUpdate_block_invoke+57
28UIKit0x005a8b4e_UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks+317
29UIKit0x0059f248_UIGestureRecognizerUpdate+199
30UIKit0x0026bd4a-[UIWindow_sendGesturesForEvent:]+1291
31UIKit0x0026cc6a-[UIWindowsendEvent:]+1030
32UIKit0x00240a36-[UIApplicationsendEvent:]+242
33UIKit0x0022ad9f_UIApplicationHandleEventQueue+11421
34CoreFoundation0x016c08af__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION+15
35CoreFoundation0x016c023b__CFRunLoopDoSources0+235
36CoreFoundation0x016dd30e__CFRunLoopRun+910
37CoreFoundation0x016dcb33CFRunLoopRunSpecific+467
38CoreFoundation0x016dc94bCFRunLoopRunInMode+123
39GraphicsServices0x036d89d7GSEventRunModal+192
40GraphicsServices0x036d87feGSEventRun+104
41UIKit0x0022d94bUIApplicationMain+1225
42Sections0x0000399dmain+141
43libdyld.dylib0x01d75701start+1
44???0x000000010x0+1
)
libc++abi.dylib:terminatingwithuncaughtexceptionoftypeNSException
(lldb)
、、、
如上所示,错误提示,使用的是XCODE5无法根据错误提示找到出错行,网上有的方法试过不可以。希望知道的同学告知下。谢谢!
繁星点点滴滴
浏览 271回答 2
2回答

阿晨1998

在Xcode的BreakpointNavigator里面添加一个异常断点(AddExceptionBreakpoint),然后将断点条件设置成Exception:Object-C,这样就能在异常抛出之前断下来,你就可以查看当时的调用栈。注意最好在快要执行到出问题代码的时候才打开这个断点,否则会不断被各种异常干扰。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript