Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.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
UIApplication sendAction:to:from:forEvent:iOS7无用户代码_Ios_Iphone_Objective C_Uikit_Ios7 - Fatal编程技术网

UIApplication sendAction:to:from:forEvent:iOS7无用户代码

UIApplication sendAction:to:from:forEvent:iOS7无用户代码,ios,iphone,objective-c,uikit,ios7,Ios,Iphone,Objective C,Uikit,Ios7,我有一个仅在iOS7上发生的崩溃。该应用程序是根据6.1 sdk编译的。我自己无法复制这一点,但我可以从崩溃报告中看到,它正在发生在一些用户身上。问题在于堆栈跟踪中没有用户代码,因此很难跟踪: Exception Type: EXC_BAD_ACCESS Code: KERN_INVALID_ADDRESS at 0x13 0 libobjc.A.dylib objc_msgSend + 5 1 UIKit -[UIApplication sendAction:to:fr

我有一个仅在iOS7上发生的崩溃。该应用程序是根据6.1 sdk编译的。我自己无法复制这一点,但我可以从崩溃报告中看到,它正在发生在一些用户身上。问题在于堆栈跟踪中没有用户代码,因此很难跟踪:

Exception Type: EXC_BAD_ACCESS Code: KERN_INVALID_ADDRESS at 0x13
0    libobjc.A.dylib     objc_msgSend + 5
1    UIKit   -[UIApplication sendAction:to:from:forEvent:] + 90
2    UIKit   -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
3    UIKit   -[UIControl sendAction:to:forEvent:] + 44
4    UIKit   -[UIControl _sendActionsForEvents:withEvent:] + 374
5    UIKit   -[UIControl touchesEnded:withEvent:] + 590
6    UIKit   -[UIWindow _sendTouchesForEvent:] + 528
7    UIKit   -[UIWindow sendEvent:] + 832
8    UIKit   -[UIApplication sendEvent:] + 196
9    UIKit   _UIApplicationHandleEventQueue + 7096
10 ...   CoreFoundation  __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
16   UIKit   UIApplicationMain + 1136
我尝试过启用僵尸并在应用程序中执行各种操作,但没有标记任何内容

更新 我认为这可能已经演变成了iOS 7.1下的[UIPickerView\u updateSelectedRows],EXC\u BAD\u访问。我会进一步调查

Thread : Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x39576626 objc_msgSend + 5
1  UIKit                          0x3187b12f -[UIPickerView _updateSelectedRows] + 54
2  UIKit                          0x3187b26f -[UIPickerView didMoveToWindow] + 78
3  UIKit                          0x3160ad37 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1358
4  UIKit                          0x3160aaa5 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 700
5  UIKit                          0x3160a40d __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 112
6  UIKit                          0x3160a263 -[UIView(Hierarchy) _postMovedFromSuperview:] + 250
7  UIKit                          0x318a2a27 __UIViewWasRemovedFromSuperview + 218
8  UIKit                          0x31609187 -[UIView(Hierarchy) removeFromSuperview] + 270
9  UIKit                          0x316cf26f -[UIPeripheralHost(UIKitInternal) adjustHostViewForTransitionCompletion:] + 310
10 UIKit                          0x31a6ca8b __53-[UIPeripheralHost(UIKitInternal) executeTransition:]_block_invoke1364 + 318
11 UIKit                          0x3164378d -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 284
12 UIKit                          0x316433d7 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 178
13 UIKit                          0x316432ef -[UIViewAnimationState animationDidStop:finished:] + 66
14 QuartzCore                     0x3128de0b CA::Layer::run_animation_callbacks(void*) + 234
15 libdispatch.dylib              0x39a55d3f _dispatch_client_callout + 22
16 libdispatch.dylib              0x39a586c3 _dispatch_main_queue_callback_4CF + 278
17 CoreFoundation                 0x2eda6679 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
18 CoreFoundation                 0x2eda4f45 __CFRunLoopRun + 1308
19 CoreFoundation                 0x2ed0f7a9 CFRunLoopRunSpecific + 524
20 CoreFoundation                 0x2ed0f58b CFRunLoopRunInMode + 106
21 GraphicsServices               0x33c6c6d3 GSEventRunModal + 138
22 UIKit                          0x3166e891 UIApplicationMain + 1136

我不知道其他崩溃报告工具,但Crashlytics包含CLS_LOG()宏:

在开发过程中,它的行为类似于NSLog(),但在字段中,日志语句包含在崩溃报告中。因此,我建议将调试语句替换为CLS_日志,或者开始在有问题的代码中添加大量捕获用户操作的语句,然后部署新版本的应用程序


(这是一个老问题,但我最近遇到了类似的问题,我想记录一下。)

尝试从以下位置删除
arm64

Project>BuildSettings>architecture>Valid architecture

并重建你的应用程序


您可能还需要将
仅构建活动架构
设置为
,它才能正常工作。

我的项目有几乎相同的崩溃日志,我们可以跟踪到动画。 问题是我们在屏幕上和屏幕下设置了UIPickerView的动画。如果在动画期间弹出并解除分配了拥有UIPickerView的ViewController。我们通过从动画完成块中的superview中删除UIPickerView解决了这个问题。

[UIView动画宽度:0.5f动画:^{
//设置PickerView的目标帧
}完成:^(布尔完成){
[self.pickerView removeFromSuperview];
}];

我刚刚收到一个类似的UIPicker崩溃。结果是,我忘记在取消分配委托之前将其设置为nil。此问题仅在启用断点的情况下运行时出现。希望这对其他人有所帮助。

在测试过程中,您是否点击了所有可点击的内容(并签入了所有动作方法实际存在的代码)?是的,我点击了视图控制器上我怀疑发生这种情况的所有按钮。我无法复制它。我也有同样的问题。请注意,它只发生在iOS7设备上。我还没有找到原因。在我们的案例中,它是由一个UIPickerView用作自定义inputView(即键盘的替代品)引起的,当ViewController换成另一个时,该视图保持打开状态。自动辞职FirstResponder的隐藏动画触发了崩溃。感谢Bart,我正在使用crashlytics,并且有面包屑,所以我知道它发生在哪个屏幕上。但是,在屏幕上跟踪到特定的用户操作是很困难的。这种情况发生在4s、5和5s上,所以我不确定这是否会有帮助。同样,辞职FirstResponder(在ViewController更改期间)上的内置动画也为我造成了这种情况
removeFromSuperview
在Dealoc中实现了这一点。我想你可能发现了一些东西,看起来我可以复制它,但以一种稍微不同的方式,如果我在弹出视图控制器时轻弹拾取轮,使其仍处于动画状态,我会崩溃。我将调查一个修复程序。如果我根据iOS7编译它,它将不再可复制。可能只有在iOS7上运行针对iOS6编译的应用程序时,问题才存在。将进行更多的测试。@Imran您是否能够确认问题只存在于针对7上运行的6编译的应用程序中?@zrxq我还没有确认,但我认为情况就是这样。一旦我发布了一个针对iOS7编译的更新,我将有更多的统计数据,并将用我的发现更新这篇文章。