gpt4 book ai didi

objective-c - 获取 NSIncation 消息的发送者

转载 作者:行者123 更新时间:2023-12-03 17:11:43 25 4
gpt4 key购买 nike

如何获取包含在“NSInvocation”中的消息的发送者?

我在一个对象中,并且我刚刚在我的 forwardInitation: 中收到了一个调用。有什么方法可以知道是谁首先向我发送了该消息吗?

最佳答案

没有。有关发件人的信息不可用(除非您显式添加 sender:self 参数)。

另请参阅此帖子 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

关于objective-c - 获取 NSIncation 消息的发送者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22745360/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com