我是iOS开发的小菜鸟,所以我遵循HelloWorld教程here。我已经到了我在添加按钮,文本字段和标签后测试应用程序的阶段。据我所知,我已经跟着教程去了信,我在运行应用时遇到了这个错误:Apple的HelloWorld教程中的NSUnknownKeyException
2013-07-13 15:26:39.629 HelloWorld [1304:11303] *终止应用程序由于 未捕获的异常“NSUnknownKeyException”,原因: “[< HelloWorldViewController 0x7566000>的setValue:forUndefinedKey:]: 这类不是密钥值编码兼容的键标签”。 *第一掷调用堆栈:(0x1c90012 0x10cde7e 0x1d18fb1 0xb79e41 0xafb5f8 0xafb0e7 0xb25b58 0x22f019 0x10e1663 0x1c8b45a 0x22db1c 0xf27e7 0xf2dc8 0xf2ff8 0xf3232 0x423d5 0x4276f 0x42905 0x4b917 0xf96c 0x1094b 0x21cb5 0x22beb 0x14698 0x1bebdf9 0x1c13f3f 0x1c1396f 0x1c36734 0x1c35f44 0x1c35e1b 0x1017a 0x11ffc 0x1f9d 0x1ec5) 的libc + + abi.dylib:终止称为抛出异常
在HelloWorldViewController.m
生成的代码是:
#import "HelloWorldViewController.h"
@interface HelloWorldViewController()
@property (weak, nonatomic) IBOutlet UILabel *label;
@property (weak, nonatomic) IBOutlet UITextField *textField;
- (IBAction)changeGreeting:(id)sender;
@end
@implementation HelloWorldViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)changeGreeting:(id)sender {
}
@end
而在HelloWorldViewController.h
:
#import <UIKit/UIKit.h>
@interface HelloWorldViewController : UIViewController
@end
我尝试使用this的答案,但我看不到一个XIB文件(我想是因为我使用的是故事板?),我不能看到任何VC差异明显。
请帮忙。
[此类不是密钥的关键值编码兼容](http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for -key) – jtbandes