Re: Building a calculator text field: problem with NSFormatter
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