"NSInternalInconsistencyException", reason: container view required.

I have an iphone application that I have been working on for some time - Xcode 5.1 iOS 7.

The starting VC has a button that launches segue on the second VC. Inside this VC there is a kind of container that has a built-in segment for the navigation controller.

Suddenly, without changing anything about the storyboard or segues, I get a failure when I try to switch to the second VC. Error:

* Confirmation error in - [UIStoryboardEmbedSegue execute], / SourceCache / UIKit_Sim / UIKit-2935.137 / UIStoryboardEmbedSegue.m: 18 2014-04-11 10: 10: 58.371 5 Star Health [42501: 60b] * Application termination due to an uncaught exception "NSInternalInconsistencyException", reason: container view required.

I tried to remake almost everything on this second VC with no luck. I also investigated the error, but did not find anything suitable.

+4
source share
2 answers

OK, I found a problem.

A controller with a container view was a custom view controller. Turns out I inherited from the UINavigationController instead of the UIViewController. Change of this is fixed.

+18
source

In my case, the problem was that I dropped the call [super loadView];in the method of the -loadViewbuilt-in custom view controller.

+6
source

Source: https://habr.com/ru/post/1536123/


All Articles