How to make target/action source in custom view?
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.