I am trying to run the following code which I found on this site, Sample code for creating a NSTextField "label"?:
#import "AppController.h"
@implementation AppController
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSTextField *textField;
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(10, 10, 200, 17)];
[textField setStringValue:@"My Label"];
[textField setBezeled:NO];
[textField setDrawsBackground:NO];
[textField setEditable:NO];
[textField setSelectable:NO];
[view addSubview:textField];
}
@end
However, I get the error: 'view' is undefined. What am I doing wrong? do I have to link something up?