Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building a calculator text field: problem with NSFormatter



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.