6
votes

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.

2
By "all of a sudden", do you mean that it had been working, but stopped working without you changing anything?rdelmar
Yes, correct. I did open the project on another machine on my network and work on it a bit without issue a few days ago, and now is the first time I am re-opening it on my normal dev machine.box86rowh
Unfortunately, this kind of problem (having to do with connections in the storyboard) are hard to diagnose without actually seeing the app. If you could post it somewhere or email it to me, I'd be happy to take a look at it, and see if it does the same thing on my machine. If you can't do that, I'd try doing a clean on the project, shut down Xcode, restart, etc.rdelmar
If it happened all of a sudden without changing anything perhaps its just a bug in XCode (I've seen this sort of thing happen many many times, you pull your hair out and it was XCode all along). If you've not already done so try deleting the derived data in Organizer and then quit XCode, also delete the app from your device before you run again.Gruntcakes
I have deleted the derived data a few times and have also deleted the app from the device and even tried it in the sim, same result. I restarted XCode multiple times.box86rowh

2 Answers

31
votes

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.

9
votes

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