NSNumberFormatter behavior
NSNumberFormatter behavior
- Subject: NSNumberFormatter behavior
- From: Chataka <email@hidden>
- Date: Tue, 6 May 2008 10:29:04 +0900
Hello,
My app has a NSTextField on a UI window to accept user input and to
display a NSNumber
in a model object. The NSTextField and the NSNumber are bound using
Cocoa Bindings,
and the NSTextField is set a NSNumberFormatter. It is a very simple UI
but I have two
problems regarding this NSTextField (NSNumberFormatter) which I don't
know how to fix.
One is that the NSTextField can't be blank. When I enter a number in
the NSTextField then
delete the number, an alert panel appears to show "Format error" and
require to fill a number
in the NSTextField. I would like to leave the NSTextField blank when
the number is deleted,
would like to set nil to the NSNumber bound in the model object, and
would like to disable
the alert panel but I don't know how.
The other problem may be the same problem as the first one. I have a
method which
handles the NSNumber in the model object and after all computations
using the NSNumber
finishes, the NSNumber is set nil at the end of the method. But the
NSTextField bound to this
NSNumber isn't cleared and continue to have the same number before the
computation, while
the NSNumber in the model object becomes nil. This breaks a
synchronization between
the UI and the model object and I would like to know how to fix this
too.
Thank you,
Chataka
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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