1

UPDATE It turns out that my renaming of my project causes these issues to happen :. I followed all these steps (How do I completely rename an Xcode project (i.e. inclusive of folders)?). I removed all my Outlets and I'm still getting the error so I still don't know what exactly is causing this to happen. For now I'm just going to revert to my previously named project and go from there. If you have any other rec's I'd appreciate them!

I'm simply trying to run my app but I get an "NSInternalInconsistencyException" exception saying that my view controller didn't get a UITableView.

I checked that my IBOutlet from my UITableView is set correctly but I'm still receiving the error..

This is how I'm declaring my IBOutlet...

class EntryViewController: SwipeTableViewController, UITextFieldDelegate {

    //MARK - IBOUTLETS

    @IBOutlet weak var entryTableView: UITableView!

    @IBOutlet weak var entryTextField: UITextField!
    @IBOutlet weak var saveButton: UIButton!
    @IBOutlet weak var heightConstraint: NSLayoutConstraint!
    @IBOutlet weak var searchBar: UISearchBar!

This is the error I'm getting:

Screenshot

* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: **'-[UITableViewController loadView] instantiated view controller with identifier "showEntries" from storyboard "Main", but didn't get a UITableView.'

libc++abi.dylib: terminating with uncaught exception of type NSException

I imagine this would link my UITableView to my ViewController.

Also, I'm subclassing a view named SwipeTableViewController from my EntryViewController...

class SwipeTableViewController: UITableViewController, SwipeTableViewCellDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()
        tableView.rowHeight = 80
    }

Wouldn't my EntryViewController be automatically subclassed to the UIViewController from there?

SOXO
  • 11
  • 4
  • Possible duplicate of [NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle](https://stackoverflow.com/questions/12722461/nsinternalinconsistencyexception-reason-could-not-load-nib-in-bundle-nsbun) – Ege Sucu Apr 23 '19 at 18:31
  • Hmm.. I'm not getting the "'Could not load NIB in bundle:" error though. I did go through the process of removing and re-adding my IBOutlets and checked if everything was renamed correctly. I also cleaned the build folder. I did rename my views in the pasta so that maybe something that's causing this :\. – SOXO Apr 24 '19 at 12:43

2 Answers2

1

Looks like you have UITableView outlet declared in UITableViewController. Make sure your class is a subclass of UIVIewController instead of UITableViewController.

In your storyboard, look for the view controller with identifier "showEntries" , delete it, and drag the UIViewController element instead of UITableViewController element.

Then drop the UITableView into the UIViewController and connect it to the tableview outlet property in your view controller.

Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109
0

Do below steps. 1.Delete all outlets from storyboard. 2.Create a class of type UIViewController. 3.Drag and drop a new tableview to the storyboard. 4.Connect all the outlets with respective UI Elements.

Or you need to make your class as UITableViewController type.

Now It will not crash.