Question

I have a storyboard app in Xcode 5 with many custom view controllers and segues and everything works well, except in one case. In this case, I have a "View Controller Scene" where I am trying to use a custom UIViewController subclass. But even though I specify the subclass, the entry in the sidebar is still called "View Controller Scene" and the View Controller entry for that scene is shown as just the generic "View Controller" (where in every other case, the scene label is changes to reflect the subclass, as is the View Controller entry).

So, Xcode does not appear to believe that I have specified a custom class for the View Controller for this scene. If it were only interface builder that was confused, that would be fine, but when I run the code, when I prepareForSegue: for the appropriate segue, the destinationViewController is a UIViewController, while I need it to be the custom subclass.

I know that my custom class must be a subclass of UIViewController, and it is (although several steps removed -- that is, it is a subclass of a subclass of a subclass of UIViewController).

The problem is not the Xcode 5 bug of not recognizing custom classes (the class name does show up in autocomplete for the Custom Class field) and Xcode has been restarted many times since this custom class was created.

So, what am I missing? What could cause Xcode 5 not to recognize a custom class for a UIViewController?

Was it helpful?

Solution

Happens all the time, easiest way to solve it: quit Xcode and run it again. The view controller should now be visible.

OTHER TIPS

Its a thing that just happens sometimes, I usually ignore it, copy the name in and hit enter, but if its bothering you, you can try to clean and build your project, should start showing up then clean: cmd + shift + k build: cmd + b

good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top