• 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: No validation with a bound NSTableView and custom NSFormatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No validation with a bound NSTableView and custom NSFormatter


  • Subject: Re: No validation with a bound NSTableView and custom NSFormatter
  • From: Ben Kennedy <email@hidden>
  • Date: Tue, 01 May 2012 20:09:27 -0700

On 01 May 2012, at 7:42 pm, Quincey Morris wrote:

> 3. That protocol has a method 'control:isValidObject:'.
>
>> "This method gives the delegate the opportunity to validate the contents of the control’s cell (or selected cell).
>
> That seems like what you want, if you query the formatter directly from this delegate method.

I hadn't noticed that one before.  However, for some reason, it does not get called on my delegate.

> Whether NSTableView has an automated mechanism for querying the formatter itself, I don't know, and I can't find any documentation that suggests it might.

Well, the NSControlTextEditingDelegate protocol also provides 'control:didFailToFormatString:errorDescription:', which seems to be to the point of what I want:

> Invoked when the formatter for the cell belonging to the specified control cannot convert a string to an underlying object.
>
> Return Value: YES if the value in the string parameter should be accepted as is; otherwise, NO if the value in the parameter should be rejected.

And unlike control:isValidObject:, it does get called on my delegate.  Unfortunately, my return value of NO seems to be ignored.

The thing about all this is that a few revs back, when I was using a dumb array with NSTableViewDataSource and no bindings, I was getting the validation behaviour for free.  Now it's gone.  I guess I should re-trace my steps and try to figure out what subtle critical difference I've introduced.

cheers,

b

--
Ben Kennedy, chief magician
Zygoat Creative Technical Services
http://www.zygoat.ca


_______________________________________________

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: No validation with a bound NSTableView and custom NSFormatter
      • From: Quincey Morris <email@hidden>
References: 
 >No validation with a bound NSTableView and custom NSFormatter (From: Ben Kennedy <email@hidden>)
 >Re: No validation with a bound NSTableView and custom NSFormatter (From: Quincey Morris <email@hidden>)
 >Re: No validation with a bound NSTableView and custom NSFormatter (From: Ben Kennedy <email@hidden>)
 >Re: No validation with a bound NSTableView and custom NSFormatter (From: Quincey Morris <email@hidden>)
 >Re: No validation with a bound NSTableView and custom NSFormatter (From: Ben Kennedy <email@hidden>)
 >Re: No validation with a bound NSTableView and custom NSFormatter (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: No validation with a bound NSTableView and custom NSFormatter
  • Next by Date: Re: No validation with a bound NSTableView and custom NSFormatter
  • Previous by thread: Re: No validation with a bound NSTableView and custom NSFormatter
  • Next by thread: Re: No validation with a bound NSTableView and custom NSFormatter
  • Index(es):
    • Date
    • Thread