Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Self-Destructing Message iPhone App Using Parse.com as a Backend and Adding Users Signing Up New Users: Part 1 (UIAlertView)

Andrew King
Andrew King
3,411 Points

NSInternalInconsistencyException

When setting up the sign up page error messages for users signing up on Ribbit and trying to run the app it's crashing with the following error message and I'm struggling to find a solution.

Any help would be greatly appreciated.

2014-10-23 11:19:10.041 Ribbit[1456:723636] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "Sgk-h2-pZH-view-40p-Va-Hre" nib but didn't get a UITableView.' *** First throw call stack: ( 0 CoreFoundation 0x0000000102e9df35 exceptionPreprocess + 165 1 libobjc.A.dylib 0x0000000102b36bb7 objc_exception_throw + 45 2 CoreFoundation 0x0000000102e9de6d +[NSException raise:format:] + 205 3 UIKit 0x000000010356c415 -[UITableViewController loadView] + 249 4 UIKit 0x00000001033af7f9 -[UIViewController loadViewIfRequired] + 75 5 UIKit 0x00000001033afc8e -[UIViewController view] + 27 6 UIKit 0x000000010356c0e3 -[UITableViewController tableView] + 30 7 UIKit 0x000000010356cb2a -[UITableViewController _viewControllerWasSelected] + 22 8 UIKit 0x00000001033eceef -[UITabBarController viewDidAppear:] + 140 9 UIKit 0x00000001033b3871 -[UIViewController _setViewAppearState:isAnimating:] + 567 10 UIKit 0x00000001033b43bb -[UIViewController _executeAfterAppearanceBlock] + 52 11 UIKit 0x00000001032ad331 _applyBlockToCFArrayCopiedToStack + 314 12 UIKit 0x00000001032ad1ca _afterCACommitHandler + 547 13 CoreFoundation 0x0000000102dd2dc7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 14 CoreFoundation 0x0000000102dd2d20 __CFRunLoopDoObservers + 368 15 CoreFoundation 0x0000000102dc8b53 __CFRunLoopRun + 1123 16 CoreFoundation 0x0000000102dc8486 CFRunLoopRunSpecific + 470 17 GraphicsServices 0x00000001053f99f0 GSEventRunModal + 161 18 UIKit 0x000000010328a420 UIApplicationMain + 1282 19 Ribbit 0x00000001013a2083 main + 115 20 libdyld.dylib 0x0000000104f1c145 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

3 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Within that dense error message is a clue:

reason: '-[UITableViewController loadView] loaded the "Sgk-h2-pZH-view-40p-Va-Hre" nib but didn't get a UITableView.'

nib refers to the screen in the storyboard that your class is hooked up to. This looks like one of your classes has a UITableView but didn't have a corresponding one in the storyboard. You can try downloading the project files for comparison to start, but let us know if you need more help.

Andrew King
Andrew King
3,411 Points

I don't understand what you mean though?

I don't at all understand how to seek out & find the one causing the problem.

Ben Jakuben
Ben Jakuben
Treehouse Teacher

It is confusing! Basically, one your your ViewController class files is expects a UITableView. The ViewControllers are connected to screens in the storyboard file, so one of those screens must be missing a UITableView. Perhaps it's even something you dragged or changed by accident.

If you'd like, zip up your project and either post a link here (Dropbox, maybe) or send it to help@teamtreehouse.com and I can help you troubleshoot with your actual code.

Andrew King
Andrew King
3,411 Points

https://www.dropbox.com/s/7itwzqv3s64h5zj/Ribbit.zip?dl=0

That should link to a zip of all my code. Eagerly awaiting your thoughts!

Andrew King
Andrew King
3,411 Points

I just noticed that part of the code is commented out in the SignUpViewController.m file in that upload.

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Cool - got it! I had a hunch of what the problem was, but let me walk you through my troubleshooting in case it can help you.

  1. I first ran the app to see the error myself (after uncommenting in SignUpViewController).
  2. Then I inserted breakpoints in viewDidLoad of Inbox and Login ViewControllers.
  3. Ran the app again. It went into InboxViewController just fine. Stepped through the code, and it crashed when trying to perform the segue into LoginViewController. viewDidLoad of LoginViewController was never called, which told me that there was a problem in the scene at the end of that segue.
  4. Checked the details of that scene and noticed that it had the wrong class linked to it:

storyboard error

  1. Switched the class to LoginViewController. Verified the fix!

Hope this helps, and good luck with the rest of the course!

Andrew King
Andrew King
3,411 Points

I hate myself for such an obvious and silly mistake. Thank you very much for taking the time to help, it is greatly appreciated.

I didn't realise just how good the "after support" would be here it's fantastic. Looking forward to progressing with the material & thank you once again.

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Don't hate yourself; consider it a badge of pride because even the most experienced developers make obvious and silly mistakes now and again. Onwards and upwards! :)