RedHatCore
2008.02.09, 10:21 AM
First of all, I have no experience programming in OS X, and very little experience programming in windows. I have read a book on C, but it was when I was very young. I'm having an issue with my first program. I'm attempting to write a program that will simply take a string and see if it is the "serial," and if it is, change a label to the serial. I've be back and forth trying to get it simply to compile, and I finally did, but it doesn't function like I would have expected. Everything expect this part of the program functions as normal:
#import "serial.h"
@implementation serial
- (void)clickButton:(id)sender;
{
NSString *text = [textField stringValue];
if (text == @"serialnum1234")
{
[label setStringValue:text];
}
}
@end
So the issue is, when I type my serial into the text field and press the OK butten, nothing happens.
The way I know that everything else in the program functions normally is due to the fact that:
NSString *text = [textField stringValue];
[label setStringValue:text];
That code does change the label to what I type in the text field when OK is clicked.
Thanks for any help.
#import "serial.h"
@implementation serial
- (void)clickButton:(id)sender;
{
NSString *text = [textField stringValue];
if (text == @"serialnum1234")
{
[label setStringValue:text];
}
}
@end
So the issue is, when I type my serial into the text field and press the OK butten, nothing happens.
The way I know that everything else in the program functions normally is due to the fact that:
NSString *text = [textField stringValue];
[label setStringValue:text];
That code does change the label to what I type in the text field when OK is clicked.
Thanks for any help.