微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ios – 这个类不是键XXXXXX的键值编码

当我尝试构建和运行我的应用程序,它崩溃,我得到了在日志中:
reason: '[<LoadingViewController 0x6b2c5a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key aproposViewController.'

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

编辑

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
这里有两个屏幕截图我的主要和在viewView中的界面构建器:

解决方法

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

因此,您可能会在一个点上在LoadViewController上创建一个名为aproposViewController的IBOutlet,将另一个视图控制器连接到该nib中,然后删除IBOutlet,但被忽略以删除该nib中的连接.

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

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

原文地址:https://www.jb51.cc/iOS/329878.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐