I'm a noob to iOS development, so am following the HelloWorld tutorial here. I've got to the stage where I'm testing the app after adding the button, text field and label. I have followed the tutorial to the letter as far as I'm aware and I'm getting this error when I run the app:
2013-07-13 15:26:39.629 HelloWorld[1304:11303] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<HelloWorldViewController 0x7566000> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key label.' * First throw call stack: (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: terminate called throwing an exception
The code generated in HelloWorldViewController.m
is:
#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
And in HelloWorldViewController.h
:
#import <UIKit/UIKit.h>
@interface HelloWorldViewController : UIViewController
@end
I tried using this answer but I can't see an XIB file (I think because I'm using a Storyboard?) and I can't see any obvious discrepancies in the VC.
Please help.