Pure Noob Here with a Pure Noob Question
Hey guys,
So I very recently started learning cocoa and am still grasping at straws with just about everything. I've made a Hello World app following a tutorial
I've got a .xib with a text box and a button, and my code:
HelloWorld.h:
#import <
@interface HelloController : NSObject {
IBOutlet NSTextField *words;
}
- (IBAction)sayHello:(id)sender;
@end
HelloWorld.m:
#import "HelloController.h"
@implementation HelloController
- (IBAction)sayHello:(id)sender{
[words setStringValue:@"Hello, World"];
[words setNeedsDisplay:YES];
}
@end
Pressing the button then updates the text box with "Hello World."
I was very excited when this compiled and ran without a flaw, so I wanted to extend it. Unfortunately this is where I ran in to trouble. I put in a ComboBox that would contain a few phrases. Selecting a phrase would change the text passed to the text box upon pushing the button.
Unfortunately, using the ComboBox apparently requires using NSNotification and NSNotificationCenter... and this is where I get lost. If anyone can help me out, suggest a few lines, explain just how those are used... anything would help me get back on track. Thanks for reading,
HolyJaw