• 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
A question about formatters/validation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A question about formatters/validation


  • Subject: A question about formatters/validation
  • From: Shamyl Zakariya <email@hidden>
  • Date: Fri, 6 Apr 2007 13:55:02 -0400

Hello,

I have a table into which the user types a numeric value. Now, the type of the value ( integer or float ) is determined by parsing the string -- e.g., "10" is an integer, where "10.0" is a float.

I know this sounds silly, but it's important since it affects the math since I'm writing a sort of programmer's calculator where 5/2 = 2, and 5.0/2 = 2.5.

So, if I use a number formatter for the table column, I know I can get input automatically restricted as a number, which is great, but since I receive an NSDecimalNumber, I have no way of determining if the value was intended to be a float or an integer.

Is there some way of using a number formatter to validate input, but still getting the actual string the user entered?

Thanks,

email@hidden
    "In the same trial, only 16 percent of those who received placebo
     sandwiches reported experiencing high levels of deliciousness."
        --The Onion


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Basic Coredata / threading question
      • From: Walt Horat <email@hidden>
  • Prev by Date: Re: WebService requests returning nil
  • Next by Date: Re: pointer address changes for no reason
  • Previous by thread: CoreData and Binding question
  • Next by thread: Basic Coredata / threading question
  • Index(es):
    • Date
    • Thread