xcode 错误:iOS9 中的 _handleNonLaunchSpecificActions

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32344082/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:45:21  来源:igfitidea点击:

Error: _handleNonLaunchSpecificActions in iOS9

iosobjective-cxcodeios9

提问by Roddy

I am getting the following error on iOS 9:

我在 iOS 9 上收到以下错误:

    -[UIApplication_handleNonLaunchSpecificActions:
      forScene:
      withTransitionContext:
      completion:] unhandled action -> 
      <FBSSceneSnapshotAction: 0x150b2aef0> 
       {
            handler          = remote;
            info = <BSSettings: 0x15333f650> 
            {
                (1) = 5;
            };
        }

Has anyone else come across this error or it's implications? What is wrong?

有没有其他人遇到过这个错误或它的影响?怎么了?

回答by Moshe

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

您的代码没有任何问题。这是 Apple 内部的日志消息,您应该提交有关它的雷达。

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

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

  1. The underscore leading the method name _handleNonLaunchSpecificActions:forScene:withTransitionContext:completionis 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 FBSSceneSnapshotActionis 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:

  1. 引导方法名称的下划线_handleNonLaunchSpecificActions:forScene:withTransitionContext:completion是一个约定,表明该方法是私有的/内部声明的类。(请参阅此注释。)

  2. 可以合理地猜测,in 的两个字母前缀FBSSceneSnapshotAction是 FrontBoard 的简写,根据 Rene Ritchie 在“ iOS 9 愿望清单:访客模式”中的说法,它是与启动应用程序相关的整个软件系列的一部分:

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. [...]

在 iOS 8 中,Apple 将其系统管理器 SpringBoard 重构为几个更小、更专注的组件。除了已经分拆出来处理后台任务的 BackBoard 之外,他们还为前台任务添加了 Frontboard。他们还添加了 PreBoard 以在安全、加密的条件下处理锁定屏幕。[...]

I have no idea what the BSprefix in BSSettingsis for, but 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.

我不知道BSin的前缀BSSettings是什么,但是对这个日志消息的分析表明这不是你做的任何事情,你应该提交一个包含重现日志消息的步骤的雷达。

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.

如果您想尝试获取堆栈跟踪,您可以实现链接到此处的类别。有些人会争辩说覆盖私有 API 是一个坏主意,但在这种情况下,临时注入以获取堆栈跟踪不会太有害。

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 FBSceneImplwhich had a whole bunch of information about my application:

但是,我们仍然想知道这个动作是什么。因此,我设置了一个断点-[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion]并开始打印寄存器值,并找到了一个名为的类FBSceneImpl,其中包含有关我的应用程序的大量信息:

Scene

场景

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

我们能够找出接下来调用哪个私有方法(存储在程序计数器寄存器 15 中)。

Program Counter

程序计数器

I tried finding the un-handled FBSceneSnapshotActionreferenced 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.

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

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

然后,我再次查看了 FBSceneSnapshotAction。原来它有一个名为BSAction.

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

然后我写了一个类似于RuntimeBrowser的工具,查找了BSAction的所有子类。事实证明,有相当多的列表:

Action List

动作列表

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.

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