Re: Current Selector
Re: Current Selector
- Subject: Re: Current Selector
- From: Greg Titus <email@hidden>
- Date: Mon, 6 Jan 2003 14:52:10 -0800
There is a hidden local variable in every method called "_cmd", which
is the current selector. This is similar to "self", but much less
commonly used. :-)
So you could just do something like:
NSLog(@"executing %@", NSStringFromSelector(_cmd));
Hope this helps,
- Greg
On Monday, January 6, 2003, at 02:35 PM, Ted Lowery wrote:
Is there a way, programmatically, to get the name of the current
selector (method) that is executing? I'm trying to log some debugging
info, and I'd like to be able to indicate the selector without having
to write a custom like of code for each method.
Cheers, Ted
_______________________________________________
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.