此类不是键值givenName的键值编码兼容

编程入门 行业动态 更新时间:2024-10-05 15:23:40
本文介绍了此类不是键值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的键值编码兼容

本文发布于:2023-11-26 19:02:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634805.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:键值   此类   givenName

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!