Exception when customizing the "Thread Name" field in the "Interface Designer"

I am trying to load a view controller from a nib in the Interface Builder. My basic setup is this:

MainWindow.xib contains: All the usual stuff, application delegation instance, window, etc.

A UINavigationController that has a UIViewController as its Root View Controller. The thread name of the UIViewController is set to the name of the xib containing my view controller.

The view controller in my separate xib has the file owner type set to the controller class for that view.

Whenever the view is loaded (ie when the app starts) an exception is thrown indicating that my controller class does not match the key value for the key [insert random variable name here]. In most cases, the key is the name I gave to the button or whatever, that I set as IBOutlet.

Why is this happening? What am I missing? I tried to create properties for each of these variables in order to generate KVC compliant accessors, but it still throws an exception.

Any help would be awesome, thanks!

0


a source to share


1 answer


The app is trying to treat your UIViewController as a UINavigationController that isn't there.

Subclass Root View Controller as UINavigationController, not UIViewController:



@interface rootViewController : UINavigationController {

      

+2


a source







All Articles