Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

this class is not key value coding-compliant for the key givenName [duplicate]

Tags:

SO i have this

- (void)loadView { BOOL success; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString* documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString* databasePath = [documentsPath stringByAppendingPathComponent:@"ProxDeals.db"]; NSError *error;  BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:databasePath]; if (fileExists==TRUE) {     [[NSBundle mainBundle] loadNibNamed:@"ProxDealsViewController" owner:self options:nil]; } else {     NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ProxDeals.db"];     NSLog(@"%@",defaultDBPath);     success = [fileManager copyItemAtPath:defaultDBPath toPath:databasePath error:&error];     if (!success) {         NSAssert1(0, @"Failed to create writable database file with message '%@/.", [error localizedDescription]);     }     [[NSBundle mainBundle] loadNibNamed:@"UserRegistration" owner:self options:nil]; } 

}

and this error:

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

I know that i don't do something wright in the initialization of the UserRegistration nib but i don't know how to fix this.

like image 277
flaviusilaghi Avatar asked Mar 28 '11 11:03

flaviusilaghi


1 Answers

This usually means that something is trying to access the @property "givenName".

If you were doing something with IB, the usual cause is that you either:

  • deleted that property from the class, but haven't deleted the hookups in IB yet
  • OR: you have a File's Owner object set to the wrong class (check the properties - different depending which version of xcode you're using - to find the Class Name its set as. You probably copy/pasted a NIB file, and didn't change this field in the NIB), and you've hooked up an outlet for that class, but your actual File's Owner is something different
like image 92
Adam Avatar answered Sep 21 '22 19:09

Adam