Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'NSInternalInconsistencyException', reason: 'containerView is required.'

I have an iphone app I have been working on for quite a while - Xcode 5.1 IOS 7.

The starting VC has a button which triggers a segue to a second VC. Inside that VC is a container view which has an embed segue to a navigation controller.

All of a sudden, without changing anything about the storyboard or segues, I am getting a crash when I attempt to segue to the second VC. The error is:

* Assertion failure in -[UIStoryboardEmbedSegue perform], /SourceCache/UIKit_Sim/UIKit-2935.137/UIStoryboardEmbedSegue.m:18 2014-04-11 10:10:58.371 5 Star Health[42501:60b] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'containerView is required.'

I have tried redoing just about everything on that second VC with no luck. I have also researched the error but have not found anything applicable.

like image 533
box86rowh Avatar asked Apr 11 '14 14:04

box86rowh


2 Answers

OK, I found the issue.

The controller with the container view was a custom view controller. Turns out I was inheriting from UINavigationController instead of UIViewController. Changing that fixed the issue.

like image 175
box86rowh Avatar answered Dec 30 '22 10:12

box86rowh


In my case, the problem was that I had omitted a call to [super loadView]; in the -loadView method of embedded custom view controller.

like image 41
Kevin Packard Avatar answered Dec 30 '22 10:12

Kevin Packard