I have a NSTextField with a NSNumberFormatter. I set the formatter with a min of 0 (because I couldn't set it to 0.01), and the style to decimal. The NSTextField has a binding on its value with a float ivar, and the action is set to "Send On Enter Only". This works just fine.
What I'd like to do is if the user tries to erase the value and either clicks off, or presses enter, I want to restore the original value before editing.
I tried:
-(void) setNilValueForKey:(NSString*) key {
if ([key compare:@"valX"] == NSOrderedSame) {
self.valX = valX;
}
}
But this doesn't set the NSTextField. I'm at a loss, any help is appreciated.
Thanks GW