• 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: Sent Actions, Delegates, Outlets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sent Actions, Delegates, Outlets


  • Subject: Re: Sent Actions, Delegates, Outlets
  • From: Graham Cox <email@hidden>
  • Date: Thu, 24 Jul 2008 16:12:13 +1000


On 24 Jul 2008, at 3:58 pm, Oleg Krupnov wrote:

target/action

Is this the same as the following?

action is sent to target on a click. The other things you mention are either
not detected or not sent on to the target.

I don't quite understand how target/action works under the hood. If I were an implementor of NSButton, how would I declare that namely the "click" event should trigger the actions in the Sent Actions list? Currently the "Sent Actions" section does not even appear in my custom view's connections menu at all, how would I make it appear?


Yes, it's the same, though usually target/action is used with standard controls and probably wouldn't be used for general signalling from a custom view unless you are doing something very control-like (in which case you could inherit from NSControl and get this support for free).

programmatically, you use -setTarget: and -setAction:

in IB, you ctrl-drag from the button to the target, and pick the action from the popup menu. This can then be reviewed in the "sent actions" section of the button's attributes under the "connections" tab.


Graham _______________________________________________

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


References: 
 >Sent Actions, Delegates, Outlets (From: "Oleg Krupnov" <email@hidden>)
 >Re: Sent Actions, Delegates, Outlets (From: Graham Cox <email@hidden>)
 >Re: Sent Actions, Delegates, Outlets (From: "Oleg Krupnov" <email@hidden>)

  • Prev by Date: Re: Sent Actions, Delegates, Outlets
  • Next by Date: Re: Help on Menu Item
  • Previous by thread: Re: Sent Actions, Delegates, Outlets
  • Next by thread: Re: Sent Actions, Delegates, Outlets
  • Index(es):
    • Date
    • Thread