如果我向目标对象发送消息,但目标对象不知道如何响应的消息(没有定义),发生这种情况后是否会调用任何方法?在 Ruby 中,有一个 method_missing 方法。 Objective-C 中有什么等价物?
最佳答案
这会抛出一个 NSException。无法识别的选择器发送到实例等等。
关于 Objective-C : Is there any callback invoked when sending a message to the object that can't respond?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12876337/