Question: I was running a game that I'm creating and the app crashed with an error that says "SIGNAL SIGABRT"

Question

I was running a game that I'm creating and the app crashed with an error that says "SIGNAL SIGABRT"

Answers 0
Added at 2017-01-01 22:01
Tags
Question

I was just running a game that I've been developing for some time, and noticed that the app crashed and it came into AppDelegate.swift with an error that says "SIGNAL SIGABRT". I don't know where this is coming from exactly, and if I did I would use other responses for this question. Can someone please help with this. Here is my code for my ViewController.swift:

import UIKit

class ViewController: UIViewController {

var randomNumber1 = arc4random_uniform(3)
var redcube1 = 0
var too = 0
var to = 0
var two = 0


override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
}



@IBOutlet weak var redcube: UIButton!
@IBOutlet weak var greencube: UIButton!
@IBOutlet weak var bluecube: UIButton!
@IBOutlet weak var redcube2: UIButton!
@IBOutlet weak var greencube2: UIButton!
@IBOutlet weak var bluecube2: UIButton!

@IBOutlet weak var howtoplay: UILabel!

@IBOutlet weak var thebutton: UIButton!

@IBOutlet weak var bluecube3: UIButton!

@IBOutlet weak var redcube3: UIButton!

@IBOutlet weak var greencube3: UIButton!

@IBOutlet weak var bluecube4: UIButton!

@IBOutlet weak var greencube4: UIButton!

@IBOutlet weak var redcube4: UIButton!




func randomnumber1() {
arc4random_uniform(3)
}







@IBAction func redcube(sender: AnyObject) {
    if redcube.hidden==false{
        too+=1
    }
       if too == 3 {
    print(randomnumber1())
    print(redcube2)
    print(redcube3)
    redcube.hidden=true
    if randomNumber1 == 1 {
    redcube.hidden=false
    }
    if randomNumber1 == 2 {
greencube.hidden=false
    }
    if randomNumber1 == 3 {
        bluecube.hidden=false
    }


    }
    else{

    }
    if redcube.hidden==false {
        greencube.hidden = true
        bluecube.hidden = true
    }
}


@IBAction func bluecube(sender: AnyObject) {


    if bluecube.hidden==false{
        to+=1
    }
    if to == 3 {
    bluecube.hidden=true
    print(bluecube2)
    print(bluecube3)
    print(randomnumber1())
    if randomNumber1 == 1 {
        redcube.hidden=false
    }
    if randomNumber1 == 2 {
        greencube.hidden=false
    }
    if randomNumber1 == 3 {
        bluecube.hidden=false
    }
    }
    else{

    }
    if bluecube.hidden==false {
        redcube.hidden=true
        greencube.hidden=true
    }
}


@IBAction func greencube(sender: AnyObject) {
    if greencube.hidden==false{
        two+=1
    }
    if two == 3 {
    greencube.hidden=true
    print(greencube2)
    print(greencube3)
    print(randomnumber1())
    if randomNumber1 == 1 {
        redcube.hidden=false
    }
    if randomNumber1 == 2 {
        greencube.hidden=false
    }
    if randomNumber1 == 3 {
        bluecube.hidden=false
    }
    }
    else{

    }
    if greencube.hidden==false {
        bluecube.hidden=true
        redcube.hidden=true
    }
}

@IBAction func redcube2(sender: AnyObject) {
    if redcube2.hidden==false{
        too+=1
    }
    if too == 3 {
redcube2.hidden=true
    print(redcube)
    print(redcube3)
    print(randomnumber1())
    if randomNumber1 == 1 {
        redcube2.hidden=false
    }
    if randomNumber1 == 2 {
        greencube2.hidden=false
    }
    if randomNumber1 == 3 {
        bluecube2.hidden=false
    }
    }
    else{

    }
    if redcube2.hidden==false {
        greencube2.hidden = true
        bluecube2.hidden = true
    }
}

@IBAction func bluecube2(sender: AnyObject) {
    if bluecube2.hidden==false{
        to+=1
    }
    if to == 3 {
    bluecube2.hidden=true
    print(bluecube)
    print(bluecube3)
    print(randomnumber1())
    if randomNumber1 == 1 {
        redcube2.hidden=false
    }
    if randomNumber1 == 2 {
        greencube2.hidden=false
    }
    if randomNumber1 == 3 {
        bluecube2.hidden=false
    }
    }
    else{

    }
    if bluecube2.hidden==false {
        redcube2.hidden=true
        greencube2.hidden=true
    }
}


@IBAction func greencube2(sender: AnyObject) {
    two+=1
    if two == 3 {
    greencube2.hidden=true
    print(greencube)
    print(greencube3)
    print(randomnumber1())
    if randomNumber1 == 1 {
        redcube2.hidden=false
    }
    if randomNumber1 == 2 {
        greencube2.hidden=false
    }
    if randomNumber1 == 3 {
        bluecube2.hidden=false
    }

    }
    else{

    }
    if greencube2.hidden==false {
        bluecube2.hidden=true
        redcube2.hidden=true
    }
}



@IBAction func redcube3(sender: AnyObject) {
    if redcube3.hidden==false{
    too+=1
    }
    if too == 3 {
        redcube3.hidden=true
        print(redcube)
        print(redcube2)
        print(randomnumber1())
        if randomNumber1 == 1 {
            redcube3.hidden=false
        }
        if randomNumber1 == 2 {
            greencube3.hidden=false
        }
        if randomNumber1 == 3 {
            bluecube3.hidden=false
        }
    }
    else{

    }
    if redcube3.hidden==false {
        greencube3.hidden = true
        bluecube3.hidden = true
    }
}


@IBAction func bluecube3(sender: AnyObject) {
    if bluecube3.hidden == false{
        to+=1
    }

    if to == 3 {
        bluecube3.hidden=true
        print(bluecube)
        print(bluecube2)
        print(randomnumber1())
        if randomNumber1 == 1 {
            redcube3.hidden=false
        }
        if randomNumber1 == 2 {
            greencube3.hidden=false
        }
        if randomNumber1 == 3 {
            bluecube3.hidden=false
        }
    }
    else{

    }
    if bluecube3.hidden==false {
        redcube3.hidden=true
        greencube3.hidden=true
    }
}


@IBAction func greencube3(sender: AnyObject) {
   if two == 3 {
        greencube3.hidden=true
        print(greencube)
        print(greencube2)
        print(randomnumber1())
        if randomNumber1 == 1 {
            redcube3.hidden=false
        }
        if randomNumber1 == 2 {
            greencube3.hidden=false
        }
        if randomNumber1 == 3 {
            bluecube3.hidden=false
        }
    }
    else{

    }
    if greencube3.hidden==false {
        bluecube3.hidden=true
        redcube3.hidden=true
    }
}


@IBAction func bluecube4(sender: AnyObject) {
    if to > 3 {
        bluecube4.hidden=true
        print(bluecube)
        print(bluecube2)
        print(bluecube3)
        print(randomnumber1())
        if randomNumber1 == 1 {
            redcube4.hidden=false
        }
        if randomNumber1 == 2 {
            greencube4.hidden=false
        }
        if randomNumber1 == 3 {
            bluecube4.hidden=false
        }
    }
    else{

    }
    if bluecube4.hidden==false {
        redcube4.hidden=true
        greencube4.hidden=true
    }


}


@IBAction func greencube4(sender: AnyObject) {
    if two > 3 {
        greencube4.hidden=true
        print(greencube)
        print(greencube2)
        print(greencube3)
        print(randomnumber1())
        if randomNumber1 == 1 {
            redcube4.hidden=false
        }
        if randomNumber1 == 2 {
            greencube4.hidden=false
        }
        if randomNumber1 == 3 {
            bluecube4.hidden=false
        }
    }
    else{

    }
    if greencube4.hidden==false {
        bluecube4.hidden=true
        redcube4.hidden=true
    }
}



   override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}


}
Answers
Source Show
◀ Wstecz