线程1:信号SIGABRT Xcode练习

时间:2015-06-23 03:12:33

标签: ios xcode swift

在我在模拟器中构建应用程序之前,Xcode不会抛出任何错误。一旦模拟器启动,它就会触发SIGABRT错误。这是我的代码:

import UIKit

class ViewController: UIViewController, UITableViewDelegate {

    var cellContent = ["example"]

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

    func numberOfRowsInSection(section: Int) -> Int {

        return cellContent.count

    }

    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

        let cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cell")

        cell.textLabel?.text = cellContent[indexPath.row]

        return cell

    }

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


}

0 个答案:

没有答案