Re: Using NSView as a template
Re: Using NSView as a template
- Subject: Re: Using NSView as a template
- From: Ryan Bates <email@hidden>
- Date: Sun, 7 Mar 2004 21:53:12 -0800
On Mar 7, 2004, at 6:34 PM, Matt Ball wrote:
Yes, I have instantiated it in Interface Builder. I can't set it as
the window delegate, however, because that is already set to
MyDocument, which is the main class for that window.
Try: [bookmarksBarItem setTarget:self];
The object does not need to be in the responder chain if the target is
specified.
(It seems some e-mails were not sent to this list, so I may be missing
something. What class is bookmarksBarItem anyway?)
Ryan
On Mar 7, 2004, at 6:34 PM, Matt Ball wrote:
On Mar 7, 2004, at 9:17 PM, Allan Odgaard wrote:
On 8. Mar 2004, at 3:09, Matt Ball wrote:
You have not showed enough code for me to verify that this is the
case, and I cannot make sense about the above, sounds like you
confuse the "responder chain" concept with something else.
Since the setTitle: does work, I would think that the setAction:
also work, but that it is the responder chain which is your
problem.
This is my entire BookmarksController.m file:
[...]
Not sure if that helps at all in diagnosing the problem. I'm pretty
new at this, and don't really have much of the lingo down. (I've got
the concepts, just don't know what to call them)
I do not see how this class should end up in the responder chain. You
can explicitly set the target for the action message on the button,
but it might be difficult in your case because of the way you
archive/unarchive the view to make a copy (a pointer to a target
might get lost in that process).
Do you instantiate your bookmarksController in the Nib file? if so,
set it up as either the window or application delegate, that should
ensure it a place in the responder chain, and so the action message
should reach your object.
Please read the programming topics of NSResponder for more info about
the responder chain and action messages.
Yes, I have instantiated it in Interface Builder. I can't set it as
the window delegate, however, because that is already set to
MyDocument, which is the main class for that window.
-- Matt Ball
_______________________________________________
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.
_______________________________________________
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.