I'm trying to create a Cocoa Objective-C program on my Snow Leopard MacBook running Xcode 4.2. Here/s what I want to do.
I have a textbox, a wrapping label, and a button. When you enter your name in the text box the wrapping label displays, "Have a merry merry christmas 'the name entered in the textbox'"
// AppDelegate.h
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
{
IBOutlet id inputTextField;
IBOutlet id outputTextField;
}
@property (assign) IBOutlet NSWindow *window;
- (IBAction)pressMeButton:(id)sender;
@end
// AppDelegate.m
#import "AppDelegate.h"
@implementation AppDelegate
//Use the pressMeButton IBAction to tell the inputTextField to display on the outputLabelField
- (IBAction)pressMeButton:(id)sender;
{
char inputString = [inputTextField charValue];
char outputString = [outputTextField charValue:(@"Have a merry merry Christmas, %@", inputString)];
[outputTextField outputString];
}
@end
I tried NSString, but I'm not sure what I'm doing wrong here.