• 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 make target/action source in custom view?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to make target/action source in custom view?


  • Subject: How to make target/action source in custom view?
  • From: Stonewall Ballard <email@hidden>
  • Date: Wed, 03 Jul 2002 18:38:57 -0400

I've seen this question asked in various groups, but the answers I've seen
don't work or seem wrong.

I have a subclass of NSView, and I want to make it possible for it to send
target/action messages to other objects, and use Interface Builder to drag
the connections.

It's easy to get "target" to show up as one of its outlets, but the outlet
is missing the little triangle that apparently indicates that I need to
select an action.

One answer I saw said that you had to add four methods to the custom class:

- (id)target
- (void)setTarget: (id)t
- (SEL)action
- (void)setAction: (SEL)s

but that didn't help.

Another answer said that my class had to be a subclass of NSControl. That
works, but there's way too much mechanism for this simple use, so it seems
wrong.

Is there a simpler way to enable this feature?

TIA,

- Stoney

--
Stonewall Ballard
email@hidden http://www.sb.org/stoney/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How to make target/action source in custom view?
      • From: Sam Griffith <email@hidden>
  • Prev by Date: Java Bridge dead - internal errors
  • Next by Date: Re: Cocoa stripping resource forks: does Jaguar fix?
  • Previous by thread: Re: Java Bridge dead - internal errors
  • Next by thread: Re: How to make target/action source in custom view?
  • Index(es):
    • Date
    • Thread