【发布时间】:2011-05-08 21:25:25
【问题描述】:
当我尝试构建和运行我的应用程序时,它崩溃了,我在日志中得到了这个:
reason: '[<LoadingViewController 0x6b2c5a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key aproposViewController.'
奇怪的是aproposViewController 没有在LoadingViewController 中使用,它只是我应用程序中的另一个视图控制器。请帮忙,谢谢提前:)
编辑
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 这是我在 main 中设置的 besic 和 interface builder 中的 loadingView 的两个屏幕截图:
【问题讨论】:
-
你可以打开aproposViewController.xib文件,查看窗口右下角是否有警告。如果不是检查检查员,(信息选项卡。)
标签: ios uiviewcontroller interface-builder