views:

52

answers:

1

I have created a three files SettingsViewController.h, SettingsViewController.m and SettingsViewController.xib.

I am showing the SwttingsViewController.xib on click of a cell in a row. There is a label and slider on xib file. It works fine. But after creating connections using interface builder. i.e drag-drop from redLabel outlet to my Label on xib file i am getting this error and app terminate.

'[<UIViewController 0x3d636d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key redLabel.'

A: 

It looks like the File Owner of the SwttingsViewController.xib has the wrong class. Go inside Interface Builder and change the class of the File Owner to be SettingsViewController. See this page for details about File Owner and UIViewController.

Laurent Etiemble
I am pointing to correct file in interface builder. Its giving me same error either my File owner's Type is empty or SettingsViewController.
coure06
Yes you are right, in code i was not initiating the controller correctly. i was doing this (wrong)controller = [[UIViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil];
coure06
It should becontroller = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil];
coure06