iphone - Xcode iOS 理解堆栈跟踪

标签 iphone objective-c ios xcode stack-trace

applicationWillTerminate 有什么问题吗?

谁能告诉我如何分析跟踪或有关异常的更多详细信息?

我试过 dwarfdump 但似乎没有更多细节。

dwarfdump -arch armv7 MyApp.app.dSYM --lookup 0x000034b3 

告诉我
Line table file: 'main.m' line 14, column 18 with start address 0x00000000000034aa

这是
int retVal = UIApplicationMain(argc, argv, nil, nil);

这是堆栈跟踪
-[UIApplication applicationWillTerminate:]: unrecognized selector sent to instance 0x27eed0
(null)
(
0   CoreFoundation                      0x30df964f __exceptionPreprocess + 114
1   libobjc.A.dylib                     0x34914c5d objc_exception_throw + 24
2   CoreFoundation                      0x30dfd1bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3   CoreFoundation                      0x30dfc649 ___forwarding___ + 508
4   CoreFoundation                      0x30d73180 _CF_forwarding_prep_0 + 48
5   CommonTools                         0x089e441f -[ButtonEventOpt onProcClickEvent:state:frame:viewControl:] + 1662
6   CommonTools                         0x089ead37 -[CommonToolsView onClickBtnEvent:] + 366
7   CoreFoundation                      0x30d69571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
8   UIKit                               0x30e77ec9 -[UIApplication sendAction:to:from:forEvent:] + 84
9   UIKit                               0x30e77e69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
10  UIKit                               0x30e77e3b -[UIControl sendAction:to:forEvent:] + 38
11  UIKit                               0x30e77b8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
12  UIKit                               0x30e78423 -[UIControl touchesEnded:withEvent:] + 342
13  UIKit                               0x30e5d535 _UIGestureRecognizerSortAndSendDelayedTouches + 2200
14  UIKit                               0x30e5cc01 _UIGestureRecognizerUpdateObserver + 696
15  CoreFoundation                      0x30dd0a35 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
16  CoreFoundation                      0x30dd2465 __CFRunLoopDoObservers + 412
17  CoreFoundation                      0x30dd375b __CFRunLoopRun + 854
18  CoreFoundation                      0x30d63ec3 CFRunLoopRunSpecific + 230
19  CoreFoundation                      0x30d63dcb CFRunLoopRunInMode + 58
20  GraphicsServices                    0x306e241f GSEventRunModal + 114
21  GraphicsServices                    0x306e24cb GSEventRun + 62
22  UIKit                               0x30e89d69 -[UIApplication _run] + 404
23  UIKit                               0x30e87807 UIApplicationMain + 670
24  MyApp                           0x000034b3 MyApp + 9395
25  MyApp                           0x0000346c MyApp + 9324
)

最佳答案

ApplicationWillTerminate 中没有错误,当您遇到 Unresolved 错误时,应用程序通常会在此处结束。

您应该在输出日志中有一些详细信息,您的主要错误似乎是您调用了一个选择器,而您调用的类不支持该选择器:

unrecognized selector sent to instance 0x27eed0  

在堆栈中,您可以看到进行了多个调用,但其中只有两个来自您自己的类(我猜,因为我不知道这些):
5   CommonTools                         0x089e441f -[ButtonEventOpt onProcClickEvent:state:frame:viewControl:] + 1662 
6   CommonTools                         0x089ead37 -[CommonToolsView onClickBtnEvent:] + 366 

检查您的输出日志,如果有更多关于引发错误的方法调用的详细信息。

关于iphone - Xcode iOS 理解堆栈跟踪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11408774/

相关文章:

ios - __bridge 不需要方法参数?

ios - UITableViewCell Frame 在我第一次加载设置后没有改变

ios - 使用 Swift3 为 iOS 中的 UIButton 设置 'backgroundColor' 动画

ios - MPRemoteCommandCenter 禁用所有控件

iphone - 在 JSON 中是什么意思

ios - 将http请求转成json

android - 在 youtube channel 上获取带有所有上传视频的 id 的 XML

iphone - 向 UITableView 添加解释性文本,例如 Things.app

iPhone开发-TableView属性

ios - 在 Collection View 的 cellForItemAtIndexPath 方法中更改框架