• 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
Bindings making NSNumberFormatter strange
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bindings making NSNumberFormatter strange


  • Subject: Bindings making NSNumberFormatter strange
  • From: Ulai Beekam <email@hidden>
  • Date: Wed, 22 Apr 2009 15:26:51 +0000
  • Importance: Normal

Hi,

I have an (editable) NSTextField with an NSNumberFormatter attached to it. The text field is bound to some other numerical property (if you want to test this, you can just make a simple AppController and put the "@property(readwrite) int foo;" inside it, and bind the text field to AppController's foo).

My problem is that when I type some invalid stuff in the text field, such as some letters "abc", I don't get a beep (which is the normal behaviour and the one I want), but I get some sheet popping up saying "Formatting Error". I don't want this sheet. I want the beep like usual. How can I get rid of this sheet behaviour that the bindings is causing? And why is it even causing it?

Second question: How can I make my text field just disallow entering of invalid characters in the first place (and producing beep when it is tried)? I want, as you probably guessed, a method that is compatible with bindings.

Thanks very much,
U
_________________________________________________________________
Show them the way! Add maps and directions to your party invites.
http://www.microsoft.com/windows/windowslive/products/events.aspx_______________________________________________

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

  • Follow-Ups:
    • RE: Bindings making NSNumberFormatter strange
      • From: Ulai Beekam <email@hidden>
  • Prev by Date: Re: Really big files and encodings
  • Next by Date: Re: Fast Forward and backward about QuickTime movie
  • Previous by thread: Re: Problem implementing keyPathsForvaluesAffecting<Key>
  • Next by thread: RE: Bindings making NSNumberFormatter strange
  • Index(es):
    • Date
    • Thread