• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem with NSNumberFormater
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: sheet comes unglued from its window
  • Next by Date: Re: UFS can't handle creation date
  • Previous by thread: Re: Problem with NSNumberFormater
  • Next by thread: Problem with setWindowFrameAutosaveName
  • Index(es):
    • Date
    • Thread