本文介绍了此类不是键值givenName的键值编码兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个
- (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]; }}
并且此错误:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ProxDealsViewController 0x5f22160> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key givenName.'我知道我在UserRegistration nib的初始化中没有做些什么,但我不知道如何解决这个问题。
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.
推荐答案这通常意味着某些东西试图访问@propertygivenName。
This usually means that something is trying to access the @property "givenName".
如果您正在对IB做某事,通常的原因是您要么:
If you were doing something with IB, the usual cause is that you either:
- 从类中删除该属性,但尚未删除IB 中的连接
- 或者:你有一个文件所有者对象设置为错误的类(检查属性 - 根据你使用的xcode版本而不同 - 查找类名它设置为。您可能复制/粘贴了一个NIB文件,并且没有在NIB中更改此字段),并且您已经连接了该类的插座,但是您的实际文件的所有者是不同
更多推荐
此类不是键值givenName的键值编码兼容
发布评论