Ios Corona SDK应用程序异常退出,信号为10:总线错误:10。设备崩溃

Ios Corona SDK应用程序异常退出,信号为10:总线错误:10。设备崩溃,ios,mobile,lua,segmentation-fault,coronasdk,Ios,Mobile,Lua,Segmentation Fault,Coronasdk,我有一个应用程序在Corona模拟器中运行良好,但在设备本身上崩溃,并且它在iOS设备控制台中返回以下错误: Mar 20 22:56:26 tmacs-iPhone backboardd[28] <Warning>: Application 'UIKitApplication:HappyShaker[0x9cf9]' exited abnormally with signal 10: Bus error: 10 Mar 20 22:56:26 tmacs-iPhone backbo

我有一个应用程序在Corona模拟器中运行良好,但在设备本身上崩溃,并且它在iOS设备控制台中返回以下错误:

Mar 20 22:56:26 tmacs-iPhone backboardd[28] <Warning>: Application 'UIKitApplication:HappyShaker[0x9cf9]' exited abnormally with signal 10: Bus error: 10
Mar 20 22:56:26 tmacs-iPhone backboardd[28] <Warning>: BKSendGSEvent ERROR sending event type 23: (ipc/send) invalid destination port (0x10000003)
当我注释掉代码中的按钮小部件部分时,它工作正常,不会崩溃。注释掉的部分在下面的代码中说明

    -- local playButton = nil
 --     local function handleButtonEvent( event )
    --  if "ended" == event.phase then
            physics.start()
            physics.setScale(60)
            physics.addBody( red, "dynamic",redBody )
            physics.addBody( borderTop, "static", borderBodyElement )
            physics.addBody( borderBottom, "static", borderBodyElement )
            physics.addBody( borderLeft, "static", borderBodyElement )
            physics.addBody( borderRight, "static", borderBodyElement )
            timer.performWithDelay(1000, fn_counter, number)
    --      playButton:removeSelf()
    --      playButton = nil
    --  end
    --  return true
    -- end
    -- playButton = widget.newButton {
    --  left = _W/2-53,
    --  top = 400,
    --  width = 105,
    --  height = 39,
    --  defaultFile = "start.png",
    --  overFile = "start_pressed.png",
    --  label = "",
    --  onEvent = handleButtonEvent,
    -- }
    -- playButton.isActive = true
    -- group:insert(playButton) 
以前有人有过按钮小部件的问题吗


我还应该提到,这段代码位于storyboard的createScene()函数中。

我找到了解决方案。它与物理有关。start()位于侦听器函数内部。我做了以下调整:

physics.start()
physics.setScale( 60 )
physics.addBody( borderTop, "static", borderBodyElement )
physics.addBody( borderBottom, "static", borderBodyElement )
physics.addBody( borderLeft, "static", borderBodyElement )
physics.addBody( borderRight, "static", borderBodyElement )

-- local startButton = nil
local function handleButtonEvent( event )
    if "ended" == event.phase then

        physics.addBody( red, "dynamic",redBody )
        timer.performWithDelay(1000, fn_counter, number)
        startButton:removeSelf()
        startButton = nil
    end
    return true
end
通过将physics.start()函数放置在侦听器事件函数之外,使其工作。然而,我仍然不明白为什么这会导致分割错误。有人能给我解释一下吗

physics.start()
physics.setScale( 60 )
physics.addBody( borderTop, "static", borderBodyElement )
physics.addBody( borderBottom, "static", borderBodyElement )
physics.addBody( borderLeft, "static", borderBodyElement )
physics.addBody( borderRight, "static", borderBodyElement )

-- local startButton = nil
local function handleButtonEvent( event )
    if "ended" == event.phase then

        physics.addBody( red, "dynamic",redBody )
        timer.performWithDelay(1000, fn_counter, number)
        startButton:removeSelf()
        startButton = nil
    end
    return true
end