SIGABRT error in Uitableview

Asked

Viewed 37 times

0

The code below compiles but then displays the error 12main SIGABRT in the appdelegate.swift, what to do? And the tableview already linked with source date and delegate to viewcontroller.

2016-01-09 16:34:54.433 Tables[17730:805874] *** Terminating app due to uncaught Exception 'Nsinternalinconsistencyexception', Report: 'Could not load NIB in Bundle: 'Nsbundle (Loaded) ' with name 'Main''

File viewcontroller.Swift

import UIKit

class ViewController: UIViewController, UITableViewDelegate {



    var cellContent = ["Ana, Lucia, Maria, Ja"]

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

        func tableView(tableView: UITableView, numberOfRowInSection 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.
        }


}

1 answer

0

This error can usually occur for 2 reasons:

  • Make sure your storyboard is added to your Copy Bundle Resources:

inserir a descrição da imagem aqui

  • Check the properties of your .storyboard or .xib is linked to the target of your project:

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.