Re: Is the sender of an obj-c method implied in the destination's method?
Re: Is the sender of an obj-c method implied in the destination's method?
- Subject: Re: Is the sender of an obj-c method implied in the destination's method?
- From: Bill Bumgarner <email@hidden>
- Date: Mon, 10 Dec 2007 21:06:23 -0800
On Dec 10, 2007, at 8:51 PM, Philip Dow wrote:
So my method just got called, [anObject called]. I'm wondering, does
an implied reference exist to the caller from inside called, like
self and _cmd? I'm looking at NSInvocation, but it doesn't look like
there's an +[NSInvocation currentInvocation] type method.
Is there a way to get this information without explicitly passing
the caller in as a parameter? Would be cool.
It isn't explicitly available, nor can you consistently unwind the
stack to figure it out. Nor is there even a guarantee that the
"sender" is really some Objective-C object; it could just as easily
be a function or FFI produced closure, in the case of the various
language bridges.
b.bum
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden