I get this message: "libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)" in my console whenever I press my button in my program. I'm not sure why this is happening...
Here is my code for the button:
class gameOverScene: SKScene {
override func didMove(to view: SKView) {
let backgroundNode = SKSpriteNode(imageNamed: "background")
backgroundNode.position = CGPoint(x: self.frame.size.width / 2, y: self.frame.size.height / 2)
self.addChild(backgroundNode)
let button = UIButton(type: .system)
button.frame = CGRect(x: 100, y: 100, width: 100, height: 50)
button.backgroundColor = UIColor.red
button.setTitle("New Game", for: .normal)
button.addTarget(self, action: Selector(("action:")), for: UIControlEvents.touchUpInside)
self.view?.addSubview(button)
func action(sender:UIButton!) {
print("button")
}
func buttonAction(sender: UIButton!) {
}
} // end didMove(to view:)
} // end class declaration