• 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
KVC Validation w/ custom Formatter not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVC Validation w/ custom Formatter not working


  • Subject: KVC Validation w/ custom Formatter not working
  • From: Luc Van Bogaert <email@hidden>
  • Date: Sun, 26 Feb 2017 21:40:28 +0100

Hello,

In Swift, I'm using a custom Formatter subclass on a NSTextField (in a table) in IB. The textfield value binding is bound to a property of my model class. This property is a typealiased Int. I would also like to use KVC validation for this property, so my model class overrides

validateValue(_ ioValue: AutoreleasingUnsafeMutablePointer<AnyObject?>, forKey inKey: String) throws

After changing the text in the textfield, my validation method is not called. When I replace my custom formatter with an instance of NSNumberFormatter, everything works as expected.

Any help with this would be greatly appreciated.

--
Luc Van Bogaert
_______________________________________________

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: KVC Validation w/ custom Formatter not working
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Need replacement of Component Manager::OpenDefaultComponent
  • Next by Date: Memory-mapped sub-data?
  • Previous by thread: Re: NSDocument autosavesInPlace + package file = no revert?
  • Next by thread: Re: KVC Validation w/ custom Formatter not working
  • Index(es):
    • Date
    • Thread