Re: Tuning KVO validation.
Re: Tuning KVO validation.
- Subject: Re: Tuning KVO validation.
- From: Óscar Morales Vivó <email@hidden>
- Date: Wed, 25 Feb 2004 13:25:33 +0100
It seems the only way to get the behaviour I want through use of
NSFormatter would be to subclass NSNumberFormatter and override either
- (BOOL)isPartialStringValid:(NSString *)partialString
newEditingString:(NSString **)newString errorDescription:(NSString
**)error
or
- (BOOL)isPartialStringValid:(NSString **)partialStringPtr
proposedSelectedRange:(NSRangePointer)proposedSelRangePtr
originalString:(NSString *)origString
originalSelectedRange:(NSRange)origSelRange errorDescription:(NSString
**)error
Which makes me think there should be a better solution...
On 25 Feb 2004, at 12:38, Allan Odgaard wrote:
On 25. Feb 2004, at 12:17, Sscar Morales Vivs wrote:
What I want is for a bad validation to make the computer beep and
revert the UI to its previous value, but I don't know how to go about
it properly (i.e. not in model code itself as that would be bad
style).
Sounds like you want to look at NSFormatter instead of bindings:
http://developer.apple.com/documentation/Cocoa/Conceptual/
DataFormatting/index.html
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSFormatter.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.