문제

How do I get the sender of the message wrapped in an `NSInvocation?

I'm in an object, and I've just received an invocation in my forwardInvocation:. Is there any way to know who sent me the message in the first place?

도움이 되었습니까?

해결책

No. Information about the sender is not available (unless you explicitly add an sender:self argument).

See also this thread http://www.cocoabuilder.com/archive/cocoa/194746-is-the-sender-of-an-obj-method-implied-in-the-destination-method.html:

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top