Here\'s the code:
- (IBAction) charlieInputText:(id)sender {
//getting value from text field when entered
charlieInputSelf = [sender stringValue];
Joshua has the right answer in the narrow case, but generally, you can't compare string objects using the == or != operators. You must use -isEqual:
or -isEqualToString:
This is because charlieImputSelf
and @""
are actually pointers to objects. Although the two sequences of characters may be the same, they need not point at the same location in memory.