• 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
How to validate the contents of an NSTextFieldCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to validate the contents of an NSTextFieldCell


  • Subject: How to validate the contents of an NSTextFieldCell
  • From: Harald E Brandt <email@hidden>
  • Date: Thu, 17 Feb 2011 19:30:31 +0100

I would like to validate the contents of an NSTextFieldCell when the user has finished editing it.

The NSTextFieldCell is in a table column in a document-based application.
An array controller manages the values, and that one works.
The text field is editable.
The NSTextFieldCell's attribute in IB for Action is set to "Send On End of Editing".

The NSTextFieldCell is bound to an outlet (File's owner) via a property thus:

property theTextField : missing value --bound as an outlet to the NSTextFieldCell in IB

In the code I then say:

theTextField's setAction_("theValidation:") --this method is in the documentation for NSActionCell, "theValidation:" is a selector.

The expectation is that the following handler would be called after editing the text field:

on theValidation_(sender)
display dialog "works"
end theValidation_

The target is by default set to nil to allow it to be determined at run time. That should be ok for me, but I also tried to set it:
theTextField's setTarget_(me)
But that did not solve anything.

What am I doing wrong, or misunderstand, or is there a smarter method?

PS: the prefix "the" in the property and handler names is actually something different in the real code, I just cleaned it from unnecessary clutter.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Recommended build settings?
  • Next by Date: Posix file?
  • Previous by thread: Re: Recommended build settings?
  • Next by thread: Posix file?
  • Index(es):
    • Date
    • Thread