iOS9的故事板什么是未处理的动作(handleNonLaunchSpecificActions)? [英] iOS9 storyboard what is unhandled action (handleNonLaunchSpecificActions)?

查看:666
本文介绍了iOS9的故事板什么是未处理的动作(handleNonLaunchSpecificActions)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用故事板时,在iOS 9上运行我的应用程序时,我注意到在控制台中弹出以下错误。我正在使用xCode7。这是我需要关心的东西吗?

   -  [UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] **未处理的操作 - > < FBSSceneSnapshotAction:0x176bfb20> {
handler = remote;
info =< BSSettings:0x176a5d90> {
(1)= 5;
};
}


解决方案

码。这是苹果内部的日志消息,您应该提供一个关于它的雷达。



有两个提示显示这是可能 Apple的代码:


  1. 下划线引导方法名称 _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion 是一个约定,表示该方法是在其声明的类的私有/内部(见



    我们可以找到下一个调用哪个私有方法(存储在程序计数器中,指令指针,注册表15)。





    我尝试找到未处理的 FBSceneSnapshotAction 引用在日志中,但没有骰子。然后,我将UIApplication子类化,并覆盖 _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion 。现在我能直接得到这个动作,但是我们还不知道是什么。



    然后,我再次查看了FBSceneSnapshotAction。结果是它有一个超类叫 BSAction



    然后我写了



    我们拥有的两个方法名称(一个来自日志,一个来自设备上的程序计数器)指示这些操作用于传递系统周围的操作。



    某些操作可能会发送到应用程序委托回调,而其他操作则会在内部处理。



    这里发生的是一个没有正确处理的操作,系统正在注意。显然,我们不应该看到它。


    I've noticed the following error popping up in the console when running my app on iOS 9 when using a storyboard. I'm using xCode7. Is this something I need to be concerned about?

    -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] ** unhandled action -> <FBSSceneSnapshotAction: 0x176bfb20> {
        handler = remote;
        info = <BSSettings: 0x176a5d90> {
            (1) = 5;
        };
    }
    

    解决方案

    There is nothing wrong with your code. This is a logging message internal to Apple, and you should file a radar about it.

    There are two hints that show that this is probably Apple's code:

    1. The underscore leading the method name _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion is a convention indicating that the method is private/internal to the class that it's declared in. (See this comment.)

    2. It's reasonable to guess that the two letter prefix in FBSSceneSnapshotAction is shorthand for FrontBoard, which according to Rene Ritchie in "iOS 9 wish-list: Guest Mode" is part of the whole family of software related to launching apps:

    With iOS 8, Apple refactored its system manager, SpringBoard, into several smaller, more focused components. In addition to BackBoard, which was already spun off to handle background tasks, they added Frontboard for foreground tasks. They also added PreBoard to handle the Lock screen under secure, encrypted conditions. [...]

    I have no idea what the BS prefix in BSSettings is for, but

    BS is shorthand for BackBoard Settings, and an analysis of this log message would indicate that it's not anything you did, and you should file a radar with steps to reproduce the logging message.

    If you want to try and grab a stack trace, you can implement the category linked to here. Some would argue that overriding private API is a bad idea, but in this case a temporary injection to grab a stack trace can't be too harmful.

    EDIT:

    But, we still want to know what this action is. So I put a breakpoint on -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion] and started printing out register values and found a class called FBSceneImpl which had a whole bunch of information about my application:

    We are able to find out which private method is called next (stored in the program counter, instruction pointer, register 15.)

    I tried finding the un-handled FBSceneSnapshotAction referenced in the log, but no dice. Then, I subclassed UIApplication, and overrode _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion. Now I was able to get at the action directly, but still, we don't know what it is.

    Then, I looked at the FBSceneSnapshotAction again. Turns out it has a superclass called BSAction.

    Then I wrote a tool similar to RuntimeBrowser and looked up all of the subclasses of BSAction. It turns out that there's quite a list of them:

    The two method names we have (one from the log and one from the program counter on the devices) indicate that these actions are used under the hood for passing actions around the system.

    Some actions are probably sent up to the app delegate's callbacks, while others are handled internally.

    What's happening here is that there is an action that wasn't handled correctly and the system is noting it. We weren't supposed to see it, apparently.

    这篇关于iOS9的故事板什么是未处理的动作(handleNonLaunchSpecificActions)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆