0

I have Main.xib and I added a new Interface SeconView.xib. I want to my secondview.xib to be default.

I changed default xib from Main Interface but I get to error like

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x880ab00> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'

. Where I did wrong ?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Mhmt
  • 759
  • 3
  • 22
  • 45
  • http://stackoverflow.com/questions/11118135/how-do-i-solve-a-nsunknownkeyexception-setvalueforundefinedkey-not – BaSha May 23 '13 at 11:04
  • possible duplicate of [What does this mean? "'NSUnknownKeyException', reason: ... This class is not key value coding-compliant for the key X"](http://stackoverflow.com/questions/3088059/what-does-this-mean-nsunknownkeyexception-reason-this-class-is-not-key) – jtbandes Aug 03 '15 at 06:46

2 Answers2

1

check your connection panel whether connection is properly set or not

manujmv
  • 6,450
  • 1
  • 22
  • 35
1

To change default nib from Main to Second , you need to perform these steps:

  • In AppDelegate's method
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

Change the argument of initWithNibName from @"Main" to @"Second"

self.viewController = [[ViewController alloc] initWithNibName:@"Second" bundle:nil];

  • Select Second.xib, and change its FileOwner to ViewController (or the controller you want to associate this nib with)

  • RighClick on View and drag New Referencing Outlet towards File Owner.

Puneet Sharma
  • 9,369
  • 1
  • 27
  • 33