• 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: NSTextField getting input number by number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField getting input number by number


  • Subject: Re: NSTextField getting input number by number
  • From: Daniel Todd Currie <email@hidden>
  • Date: Sat, 15 Nov 2003 03:18:13 -0800

I just learned this stuff recently myself, so don't take my comments with any authority...

I believe the problem is that the formatter is programatically changing the contents of your text field. The controlTextDidChange: method is only called when the user makes a change. I am guessing that you did not actually type the period into the field yourself (the formatter did it for you)? In any case, it is easy to imagine how there could be conflicts/overlaps between the controlTextDidChange: method and a formatter...

I would consider setting up your formatter with the controller as a delegate. The delegate method could probably replace your controlTextDidChange: method verbatim. This way you can have complete control over when the delegate method is called--and what information is sent.

// Daniel Currie


On 2003 Nov 14, at 23:57, Jay Rimalrick wrote:

i am using controlTextdidChange but it does not work when I have the
textfield formatted to handle money or float values larger than 0 ... for some
reason It will not pick up the decimal

if i type in 1.2 it only recognized 12

any idea?


- (void)controlTextDidChange:(NSNotification *)aNotification

At 5:51 PM -0500 11/14/03, Jay Rimalrick wrote:
I want to capture a number being typed into an NSTextField number by
number including float values. Thus entering 1.2 would work like this

type 1 -> (calculations are done for the value 1)
type . -> (calculations are done for the value 1.)
type 2 -> (calculations are done for the value 1.2)

What delegate method should I use for this? I am also trying to use an
Interface Builder formatter on the NSTextField to keep the values positive.

Thanks in advance,
jay






________________________________________________________________
Sent via the WebMail system at 1st.net
_______________________________________________
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.
_______________________________________________
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.

References: 
 >Re: NSTextField getting input number by number (From: "Jay Rimalrick" <email@hidden>)

  • Prev by Date: Re: NSTextField getting input number by number
  • Next by Date: Re: NSTextField getting input number by number
  • Previous by thread: Re: NSTextField getting input number by number
  • Next by thread: Re: NSTextField getting input number by number
  • Index(es):
    • Date
    • Thread