Re: Conceptual problem
Re: Conceptual problem
- Subject: Re: Conceptual problem
- From: Sherm Pendley <email@hidden>
- Date: Thu, 9 Jan 2003 04:51:17 -0500
On Thursday, January 9, 2003, at 12:01 AM, Michael Norris wrote:
My question is: how do I send a message from a "view" class to a
"controller" class (MVC)? (At least I think that's my question...)
The methods for this are inherited from NSControl. Assuming you've made
the proper connections in IB, you'd do something like this:
[self sendAction: @selector(aMessage:) to: [self target]];
Why use sendAction:to: instead of directly sending the message with
[[self target] aMessage: self]? Because if you connect your control to
the "First Responder" in IB, [self target] will return nil. Sending a
message directly to a nil object does nothing, but if sendAction:to: is
given a nil target, it will search through the responder chain to look
for an object that implements a method to handle the action.
sherm--
UNIX: Where /sbin/init is Job 1.
_______________________________________________
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.