Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 应用程序崩溃而没有通过我的代码_Objective C_Ios_Crash_Uikit_Segmentation Fault - Fatal编程技术网

Objective c 应用程序崩溃而没有通过我的代码

Objective c 应用程序崩溃而没有通过我的代码,objective-c,ios,crash,uikit,segmentation-fault,Objective C,Ios,Crash,Uikit,Segmentation Fault,在分析我们的崩溃日志时,我发现一个相当常见的崩溃是我自己的一个类中甚至没有发生过的。这些是外部崩溃日志,因此我无法重现问题 既然我不能调试这个框架,我想知道有什么切实可行的方法可以解决这个问题 我唯一的线索是SIGSEGV可能是分段错误或无效指针。但正如我所说,由于我的课程似乎没有直接参与,这对我没有多大帮助 坠机事件: Exception Type: SIGSEGV Exception Codes: SEGV_ACCERR at 0x6b636f6c Crashed Thread: 0

在分析我们的崩溃日志时,我发现一个相当常见的崩溃是我自己的一个类中甚至没有发生过的。这些是外部崩溃日志,因此我无法重现问题

既然我不能调试这个框架,我想知道有什么切实可行的方法可以解决这个问题

我唯一的线索是SIGSEGV可能是分段错误或无效指针。但正如我所说,由于我的课程似乎没有直接参与,这对我没有多大帮助

坠机事件:

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x6b636f6c
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib                     0x365c7f94 objc_msgSend + 43
1   CoreFoundation                      0x31cd23fd -[NSObject performSelector:withObject:withObject:] + 52
2   UIKit                               0x3291cfaf -[UIApplication sendAction:to:from:forEvent:] + 62
3   UIKit                               0x3291cf6b -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
4   UIKit                               0x3291cf49 -[UIControl sendAction:to:forEvent:] + 44
5   UIKit                               0x3291ccb9 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 492
6   UIKit                               0x3291d5f1 -[UIControl touchesEnded:withEvent:] + 476
7   UIKit                               0x3291bad3 -[UIWindow _sendTouchesForEvent:] + 318
8   UIKit                               0x3291b4c1 -[UIWindow sendEvent:] + 380
9   UIKit                               0x3290183d -[UIApplication sendEvent:] + 356
10  UIKit                               0x329010e3 _UIApplicationHandleEvent + 5826
11  GraphicsServices                    0x3572d22b PurpleEventCallback + 882
12  CoreFoundation                      0x31d4c523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
13  CoreFoundation                      0x31d4c4c5 __CFRunLoopDoSource1 + 140
14  CoreFoundation                      0x31d4b313 __CFRunLoopRun + 1370
15  CoreFoundation                      0x31cce4a5 CFRunLoopRunSpecific + 300
16  CoreFoundation                      0x31cce36d CFRunLoopRunInMode + 104
17  GraphicsServices                    0x3572c439 GSEventRunModal + 136
18  UIKit                               0x3292fe7d UIApplicationMain + 1080
19  MyApp                               0x0000321f main (main.m:14)

此崩溃可能是由于您的错误造成的。如果您查看堆栈跟踪顶部的几行,它应该会提示您出了什么问题

1   CoreFoundation   0x31cd23fd -[NSObject performSelector:withObject:withObject:] + 52
2   UIKit            0x3291cfaf -[UIApplication sendAction:to:from:forEvent:] + 62
3   UIKit            0x3291cf6b -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
4   UIKit            0x3291cf49 -[UIControl sendAction:to:forEvent:] + 44

看起来您在某个地方有一个对象,可能是一个为事件注册的视图控制器,但很快就被解除分配。最好的做法是在连接到调试器时尝试复制该命令。首先检查处理UIControl回调(如UIButtons)的代码。

此崩溃可能是您的错误造成的。如果您查看堆栈跟踪顶部的几行,它应该会提示您出了什么问题

1   CoreFoundation   0x31cd23fd -[NSObject performSelector:withObject:withObject:] + 52
2   UIKit            0x3291cfaf -[UIApplication sendAction:to:from:forEvent:] + 62
3   UIKit            0x3291cf6b -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
4   UIKit            0x3291cf49 -[UIControl sendAction:to:forEvent:] + 44

看起来您在某个地方有一个对象,可能是一个为事件注册的视图控制器,但很快就被解除分配。最好的做法是在连接到调试器时尝试复制该命令。首先检查处理UIControl回调的代码,如UIButtons。

可能是一些静态构造函数?静态块在主应用程序之前至少在C++中执行,但是我怀疑目标C没有区别,好像UnCopTROL/UBITCON的目标被设置为一个对象,当按钮被按下时,它不再存在。您的问题解决了吗?问题的原因是什么?@foogry这是两年多前的事了,所以我不知道确切的问题是什么,但我接受了下面的答案,所以这可能会给你一个提示。可能是某个静态构造函数?静态块在主应用程序之前至少在C++中执行,但是我怀疑目标C没有区别,好像UnCopTROL/UBITCON的目标被设置为一个对象,当按钮被按下时,它不再存在。您的问题解决了吗?问题的原因是什么?@foogry这是两年多前的事了,所以我不知道确切的问题是什么,但我接受了下面的答案,所以这可能会给你一个提示。我不太确定你所说的UIControl回调(如UIButtonSuiControl)的意思通常是通过处理用户输入然后调用代码来工作的。因此,如果使用IB,按下UIButton将调用您的方法iAction,例如-iActionButtonPressed:idsender。如果包含buttonPressed:的类在事件激发之前被释放,那么这将导致应用程序崩溃。UISwitch、UISlider等也是如此。我在ApplicationIDFinishLaunching方法中演示了一个viewcontroller,但没有保留它。这解决了我的问题,谢谢!!!我不太清楚您所说的UIControl回调是什么意思,例如UIButtonSuiControl通常通过处理用户输入然后调用您的代码来工作。因此,如果使用IB,按下UIButton将调用您的方法iAction,例如-iActionButtonPressed:idsender。如果包含buttonPressed:的类在事件激发之前被释放,那么这将导致应用程序崩溃。UISwitch、UISlider等也是如此。我在ApplicationIDFinishLaunching方法中演示了一个viewcontroller,但没有保留它。这解决了我的问题,谢谢!!!