Here\'s the code:
- (IBAction) charlieInputText:(id)sender {
//getting value from text field when entered
charlieInputSelf = [sender stringValue];
The easiest way to do it.
Create new NSString without " " (spaces)
NSString *textWithoutSpaces = [self.textField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
Now you have string without spaces. You just have to check is this string empty or not.
if (textWithoutSpaces != 0) {
/* not empty - do something */
} else {
/* empty - do something */
}