对于密钥XXXXXX,此类不符合密钥值编码 [英] this class is not key value coding-compliant for the key XXXXXX

查看:253
本文介绍了对于密钥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

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

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.

所以你可能在一个点上在一个点上有一个名为aproposViewController的IBOutlet,在nib中将另一个视图控制器连接到它,然后删除了IBOutlet但忽略了删除nib中的连接。

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天全站免登陆