Re: Question on cocoa style: value for (id)sender parameter
Re: Question on cocoa style: value for (id)sender parameter
- Subject: Re: Question on cocoa style: value for (id)sender parameter
- From: Evan Schoenberg <email@hidden>
- Date: Mon, 24 Jan 2005 15:51:41 -0600
On Jan 24, 2005, at 3:10 PM, Larry Fransson wrote:
On Jan 24, 2005, at 12:24, Matt Gillette wrote:
[aSheet orderOut:NULL];
[aSheet orderOut:self];
Is there any advantage to null/nil versus self? What is the sender
variable used for?
There may be occasions, particularly in IBAction methods that you
write, where the action taken might depend on what is triggering the
action. The sender parameter allows you to figure out what is
triggering the action so that you can decide what to do.
And on the other side of the spectrum, I generally use nil when calling
my action/notificaiton methods manually so I can distinguish between an
invocation I made and invocation made because of user action or because
I am an observer for the relevant notification.
-Evan
Larry Fransson
Seattle, WA
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden