我有这个
- (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];
}
Run Code Online (Sandbox Code Playgroud)
}
而这个错误:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ProxDealsViewController 0x5f22160> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key givenName.'
Run Code Online (Sandbox Code Playgroud)
我知道我在UserRegistration nib的初始化中没有做些什么,但我不知道如何解决这个问题.
Ada*_*dam 85
这通常意味着某些东西试图访问@property"givenName".
如果你正在做IB的事情,通常的原因是你要么:
| 归档时间: |
|
| 查看次数: |
40926 次 |
| 最近记录: |