NSFormatter Question: NSTextField should not be left blank
NSFormatter Question: NSTextField should not be left blank
- Subject: NSFormatter Question: NSTextField should not be left blank
- From: Heiko <email@hidden>
- Date: Mon, 10 Jun 2002 21:01:27 +0200
Mike,
First, thanks for your reply.
>
Use NSFormatter's isPartialStringValid:newEditingString:errorDescription:.
I tried
- (BOOL)isPartialStringValid:(NSString **)partialStringPtr
proposedSelectedRange:(NSRangePointer)proposedSelRangePtr
originalString:(NSString *)origString
originalSelectedRange:(NSRange)origSelRange
errorDescription:(NSString **)error
and
- (void)textDidEndEditing:(NSNotification *)aNotification
but both won't get called when the user leaves a NSTextField blank. The first will only be called if the user types something. The latter will be called when he did type and the leaves.
My NSTextFields are initally blank. The cursor is placed into one. In the case the user doesn't type anything, and he clicks another field, none of the routines will get called. The only one getting called is getObjectValue! I return an error in that routine, but the NSTextField then doesn't call didFailToFormatString. didFailToFormatString only gets called when the user did type something. For me, this is most likely a bug.
Is there no way to prevent the user of leaving the NSTextField when he didn't type anything?
Of course, I could fill the NSTextFields with dummy data - but that's quite a hack.
Does anybody have an idea?
TIA,
--
Heiko-- 8:55PM up 8 days, 9:34, 2 users, load averages: 2.68, 2.02, 1.83
_______________________________________________
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.