• 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: Building a calculator text field: problem with NSFormatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building a calculator text field: problem with NSFormatter


  • Subject: Re: Building a calculator text field: problem with NSFormatter
  • From: Joel Norvell <email@hidden>
  • Date: Thu, 30 Nov 2006 00:23:12 -0800 (PST)

Hi Niko,

I'm not a Cocoa expert.  Nor am I familiar with Quicken.   But I do have some
thoughts on your problem.  First, I don't think you want to use a formatter for
what you're trying to do.  When a complete expression has been entered you'd
want to see if it was well-formed.  A "- (BOOL) canParse;" method that tested
the expression would let you determine if it could be evaluated.  Then you
could evaluate it with a method like "- (float) evaluateExpression;"  These
methods could be part of a NSObject subclass.  Instances of this subclass would
be the delegates of your NSTextField subclasses.  This isn't very detailed, but
I think it gives you an alternate approach that would work.

Sincerely,
Joel




____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
_______________________________________________

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

  • Prev by Date: Re: NSImage TIFFRepresentation memory leak
  • Next by Date: MAC C++ Cocoa Developer required
  • Previous by thread: Re: Building a calculator text field: problem with NSFormatter
  • Next by thread: MAC C++ Cocoa Developer required
  • Index(es):
    • Date
    • Thread