• 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: Tuning KVO validation.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tuning KVO validation.


  • Subject: Re: Tuning KVO validation.
  • From: Óscar Morales Vivó <email@hidden>
  • Date: Wed, 25 Feb 2004 13:25:33 +0100

It seems the only way to get the behaviour I want through use of NSFormatter would be to subclass NSNumberFormatter and override either

- (BOOL)isPartialStringValid:(NSString *)partialString newEditingString:(NSString **)newString errorDescription:(NSString **)error

or

- (BOOL)isPartialStringValid:(NSString **)partialStringPtr proposedSelectedRange:(NSRangePointer)proposedSelRangePtr originalString:(NSString *)origString originalSelectedRange:(NSRange)origSelRange errorDescription:(NSString **)error

Which makes me think there should be a better solution...

On 25 Feb 2004, at 12:38, Allan Odgaard wrote:

On 25. Feb 2004, at 12:17, Sscar Morales Vivs wrote:

What I want is for a bad validation to make the computer beep and revert the UI to its previous value, but I don't know how to go about it properly (i.e. not in model code itself as that would be bad style).

Sounds like you want to look at NSFormatter instead of bindings:

http://developer.apple.com/documentation/Cocoa/Conceptual/ DataFormatting/index.html

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Classes/NSFormatter.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Tuning KVO validation.
      • From: Allan Odgaard <email@hidden>
References: 
 >Tuning KVO validation. (From: Óscar Morales Vivó <email@hidden>)
 >Re: Tuning KVO validation. (From: Allan Odgaard <email@hidden>)

  • Prev by Date: Re: red black trees
  • Next by Date: Re: Side-affect free methods?
  • Previous by thread: Re: Tuning KVO validation.
  • Next by thread: Re: Tuning KVO validation.
  • Index(es):
    • Date
    • Thread