84

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;
    };
}
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
  • Apple says iOS 9 is about stability, so I guess you should not worry ;-) P.S. I have the same issue, and some other devs too http://stackoverflow.com/questions/32344082/handlenonlaunchspecificactions-error-in-ios9 – Roma Sep 19 '15 at 05:01
  • 11
    Not sure if it is related to Storyboards, I see it too in my non-Storyboard app. – koen Sep 24 '15 at 11:53
  • Are there any other warnings in the build? Maybe it's a warning that seems trivial? – Joe Susnick Sep 27 '15 at 16:25
  • I'm not using storyboards and also get this warning. It pops up when you lock the simulator with CMD + L and then "slide to unlock" to get back in the app. – SDW Sep 29 '15 at 20:41
  • Looking at the device log, it could have something to do with automatically turning the device's screen off. The line `SpringBoard[54] : [MPUSystemMediaControls] Disabling lock screen media controls updates for screen turning off.` is logged right before the cited error message. – Christian Oct 08 '15 at 10:50
  • I took a deep dive into this question: http://stackoverflow.com/a/34911563/224988 – Moshe Feb 01 '16 at 18:37

4 Answers4

32

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:

Scene

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

Program Counter

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:

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.

Community
  • 1
  • 1
Moshe
  • 57,511
  • 78
  • 272
  • 425
  • Nice investigation but here is something interesting, I am getting the exact OP error when using private Apple API. I guess since I am using the private API then I am getting console log probably for Apple engineers. – OhadM Feb 11 '16 at 09:49
  • 1
    @Moshe How much did Apple paid you for investigating on their behalf? But they might not be interested in it. :p – codelearner Mar 27 '16 at 22:04
  • What does "file a radar about it" mean? – Paul Masri-Stone May 06 '17 at 21:21
  • It means to file a bug report with Apple's bug reporter tool. – Moshe May 07 '17 at 02:28
12

AFAIK, the info above is related to iOS during snapshot the screen (i suppose for double click home multitask related behaviour).I deeply investigated my application and seems that it does not get any side behaviours. You can safely ignore it, for now.

You can use the following gist simple category to test yourself against the calls to the above function:

valvoline
  • 7,737
  • 3
  • 47
  • 52
1

I have figured it out, it will happen when you have IBAction method declared in .h or .m file but you have not bind it to any control.

.m example:

- (IBAction)click:(id)sender{
}

but not assigned this method to any control in storyboard.

jherran
  • 3,337
  • 8
  • 37
  • 54
Seema Sharma
  • 379
  • 3
  • 12
  • This is not the case in my app - I don't have any unbound IBActions, and I get this message too. My app is a Swift app though. – henrikstroem Jan 21 '16 at 06:15
1

haven't find out why it happens in my app, but at least you can catch the exception, if you want to keep this from popping up in your log pane. It's not a solution, but it might give you more insight why it is happing by inspecting any of the arguments that are passed in the catch.

swift 2 version:

import UIKit

extension UIApplication {
    func _handleNonLaunchSpecificActions(arg1: AnyObject, forScene arg2: AnyObject, withTransitionContext arg3: AnyObject, completion completionHandler: () -> Void) {
        //whatever you want to do in this catch
        print("handleNonLaunchSpecificActions catched")
    }
}
Marc D.
  • 74
  • 8