【问题标题】:How to solve exc Bad access thread when click on UiButton?单击UiButton时如何解决exc Bad access thread?
【发布时间】:2015-08-24 11:54:25
【问题描述】:

我是 iOS 开发新手,我的应用程序在单击按钮时崩溃。我收到一个错误“exc Bad access thread”。请显示应用程序真正导致的图像

这是我的代码

if(self.VKPlayer != nil)
    {
        if(self.isPlayerMuted == false)
        {
            self.isPlayerMuted = true;
            self.VKPlayer.setMute(true);
            button.selected = true;
        }
        else
        {
            self.isPlayerMuted = false;
            self.VKPlayer.setMute(false);
            button.highlighted = true;
            button.selected = false;
        }
    }

请帮帮我..

【问题讨论】:

  • 使用您的按钮 IBAction 检查。
  • 哪一行导致崩溃?
  • 启用断点异常并查看崩溃的确切原因
  • 我收到 BAD_EXC_ACCESS 的线程错误,使用 AUREMOTEIO::IO
  • 你在 Xcode 中启用断点异常了吗?

标签: ios xcode swift uibutton


【解决方案1】:

在您的IBAction 中设置一个断点,看看它是否会被触发。还要检查 IBAction 中的任何代码是否错误。

如果您的代码看起来正确,请检查您是否有死连接。右键单击情节提要上的视图控制器图标并删除带有黄色箭头的任何连接。然后重新连接。

【讨论】:

    猜你喜欢
    • 2020-04-27
    • 1970-01-01
    • 1970-01-01
    • 2011-11-29
    • 1970-01-01
    • 1970-01-01
    • 2015-12-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多