1

I started working on app development tutorials from today and already started facing hard to deal bug. I know it may be easy for pro developers, but not for me.

The simple app I made is - To Do List

Under new project -> Tabbed Application - > Swift -> iPhone This is the code for second view controller,

    import UIKit

class SecondViewController: UIViewController {
var toDoItems:[String] = []

    @IBOutlet weak var toDoItem: UITextField!

    @IBAction func addItem(sender: AnyObject) {

        toDoItems.append(toDoItem.text)

        println(toDoItems)

    }

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

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


}

I am sick of this SIGABRT problem. Other people are using the exact same code that I am and there program is working perfectly fine. Not sure why I am having this issue.

I tried the following:

  • Clear the cache

  • Restarted the Xcode multiples times

  • Redid the complete code again saving as a completely different file

I am using the following:

  • xcode 6.0.1 (6A317)

  • OS Yosemite

  • I have a developer account

4

1 回答 1

1

我有同样的错误,我知道这很令人沮丧,但这绝对是愚蠢的。问题出在插座上。也许您删除了代码行和/或替换了它,但链接仍然存在。

在你的 main.storyboard 检查所有的插座,控制+(点击插座)并检查它是否链接到某个东西。一旦您更正它应该可以正常运行。

于 2016-06-24T19:47:56.587 回答