此类不符合键值 XXXXXX 的键值编码 [英] this class is not key value coding-compliant for the key XXXXXX

查看:16
本文介绍了此类不符合键值 XXXXXX 的键值编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试构建和运行我的应用程序时,它崩溃了,我在日志中看到了这个:

when i try to build and run my app, it crashes and i got this in the log :

reason: '[<LoadingViewController 0x6b2c5a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key aproposViewController.'

奇怪的是 aproposViewController 没有在 LoadingViewController 中使用,它只是我应用程序中的另一个视图控制器.请帮忙,提前谢谢:)

the strange is that aproposViewController is not used in LoadingViewController, it's just another view controller in my app. please help, thx in advance :)

编辑

appdelegate.h :

@class LoadingViewController;

@interface TopStationAppDelegate : NSObject <UIApplicationDelegate,CLLocationManagerDelegate> {
    UIWindow *window;
    LoadingViewController *loadingView;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet LoadingViewController *loadingView;
@end

appdelegate.m:

#import "LoadingViewController.h"
@implementation TopStationAppDelegate
@synthesize window;
@synthesize loadingView;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
  [window addSubview:loadingView.view];
    [window makeKeyAndVisible];
    return YES;
}
- (void)dealloc {
    [loadingView release];
    [window release];
    [super dealloc];
}
@end

没有 aproposViwController 的声明,即使在主视图的 IB 中!编辑 2这里有两个屏幕截图,我在主界面和 loadingView 中设置了界面构建器:

there is no declaration of aproposViwController, even in IB for the main view !! EDIT 2 here two screenshot of my besic set in the main and loadingView in interface builder :

推荐答案

无法确定这是否是您的情况,但如果您在笔尖中设置了连接,您通常会看到此消息将一个对象分配给另一个对象的属性,但目标对象上缺少该属性.

Can't be sure if this is what's happening in your case, but you'll commonly see this message if you have a connection set up in your nibs to assign an object to a property of another object, but the property is missing on the target object.

因此,您可能曾经在 LoadingViewController 上有一个名为 aproposViewController 的 IBOutlet,在笔尖中将另一个视图控制器连接到它,然后移除了 IBOutlet 但忽略了移除笔尖中的连接.

So you might have had an IBOutlet named aproposViewController on LoadingViewController at one point, connected another view controller to it in the nib, and then removed the IBOutlet but neglected to remove the connection in the nib.

所以当nib被加载时,它试图设置属性,却发现它不存在,因此:

So when the nib is loaded, it tries to set the property, only to find it doesn't exist, hence:

reason: '[<LoadingViewController 0x6b2c5a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key aproposViewController.'

这篇关于此类不符合键值 XXXXXX 的键值编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆