• 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: Binding button.enabled to "NSTextField is not empty"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding button.enabled to "NSTextField is not empty"


  • Subject: Re: Binding button.enabled to "NSTextField is not empty"
  • From: mmalcolm crawford <email@hidden>
  • Date: Tue, 26 Apr 2005 17:28:55 -0700


On Apr 26, 2005, at 5:01 PM, Andrew White wrote:

I have an NSObjectController. This models my "system". I add a "myText" (or "myString" in Alex' code) property to this controller to hold the text that both the field and the button will operate upon.


Without seeing exactly what was proposed, it looks like you're suggesting adding an instance variable to a subclass of NSObjectController? In which case, no: 'myText' or whatever should be a property of the model -- the object controller's content -- not of the object controller itself.


Most of the other questions are answered in the documentation, but specifically:

(6) If I want to snarf the value of the text field (as part of the action invoked when the button is pressed), do I connect my outlet to the text field or to the NSObjectController? What is the functional difference? Is one or other preferred?

*If I understand correctly what you intend*, you should not be "snarfing a value from a text field", you should be referring to a model property. One variant would be to use the button's 'target' and 'argument' bindings to send a message "directly" rather than using an action method -- you would bind 'argument' to the same property as the text field's 'value' is bound to.


mmalc

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Binding button.enabled to "NSTextField is not empty" (From: Andrew White <email@hidden>)

  • Prev by Date: Re: Binding button.enabled to "NSTextField is not empty"
  • Next by Date: Re: "VMWare" for the Mac - running OSX on OSX
  • Previous by thread: Re: Binding button.enabled to "NSTextField is not empty"
  • Next by thread: Re: Binding button.enabled to "NSTextField is not empty"
  • Index(es):
    • Date
    • Thread