_BSMachError XCode 7 Beta

前端 未结 8 1613
后悔当初
后悔当初 2020-12-08 00:15

I am getting the following error when I am running my code in Xcode7 with Swift2, after presenting a view controller through a push segue:

_BSMachError: (os/         


        
相关标签:
8条回答
  • 2020-12-08 00:28

    I got these errors when I was using the keyboard. According to this note in Apple Docs, this is somewhat expected.

    http://cocoadocs.org/docsets/Keyboard/0.3.0/

    0 讨论(0)
  • 2020-12-08 00:29

    I had the same two error messages. In my case, the errors were appearing when I called [[UIApplication sharedApplication] openURL:url] after the user selected a button in an open UIAlertController. I assumed the alert was trying to close at the same time I was trying to open the URL. So, I introduced a slight delay and the error message went away.

    dispatch_after(0.2, dispatch_get_main_queue(), ^{
        [[UIApplication sharedApplication] openURL:url];
    });
    

    Not sure if this helps with your particular problem, but I thought it might be helpful to share.

    0 讨论(0)
  • 2020-12-08 00:31

    I had this problem while debugging and it disappeared when I removed a breakpoint in my response to the view size changing.

    0 讨论(0)
  • 2020-12-08 00:38

    Having this statement right below IBAction Button was causing the issue.

    self.view.endEditing(true)
    

    The issue was fixed in Swift 3, by commenting out the above line and handling the end editing in a different way, or can also be fixed adding the above line after all other code under IBAction.

    0 讨论(0)
  • 2020-12-08 00:40

    Dismissing view controller prematurely might cause this.

    [self dismissViewControllerAnimated:YES completion:NULL]; 
    //<do something..>
    

    This throws _BSMachErrors

    vs

    //<do something..>
    [self dismissViewControllerAnimated:YES completion:NULL]; 
    

    Now, the _BSMachError is gone.

    0 讨论(0)
  • 2020-12-08 00:42

    Change the Localization native development region key in your info.plist from en to United States

    0 讨论(0)
提交回复
热议问题