Re: Problem with NSNumberFormater
Re: Problem with NSNumberFormater
- Subject: Re: Problem with NSNumberFormater
- From: Matt Neuburg <email@hidden>
- Date: Fri, 20 Sep 2002 06:48:14 -0700
On Thu, 19 Sep 2002 20:27:00 +0200, Claudius Sailer
<email@hidden> said:
>
I tested controlTextDidChange. Code:
>
>
if (([[curName stringValue] length] > 0) && ([[curValue
>
stringValue] length] > 0) && ([curValue doubleValue] > 0)) {
>
[calcButton setEnabled:YES];
>
} else {
>
[calcButton setEnabled:NO];
>
}
>
>
the result is, that the NSForm Cell 2 which is formatted with
>
NSNumberFormater brings after the first number I typed automatically a
>
complete result:
>
>
1 --> 1.0000
>
2 --> 2.0000
>
>
But I want to type 1,2345 without the formatation because I have in the
>
settings "On end editing".
First, putting that code in controlTextDidChange doesn't change the display
of the field, so the phrase "the result is" is just plain wrong. Second, if
you want to control how a field is displayed as you type, that's the job of
a formatter. Third, when you query a field that is controlled by a
formatter, distinguish carefully as to whether you want to talk to its
stringValue or its objectValue. m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
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.