Objective-C : Is there any callback invoked when sending a message to the object that can't respond?

标签 objective-c ios

如果我向目标对象发送消息,但目标对象不知道如何响应的消息(没有定义),发生这种情况后是否会调用任何方法?在 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/

相关文章:

objective-c - 带有 NSMutableDictionary (Objective-C) 的对象键

ios - 为什么我的 setter 方法没有被调用?

ios - 通过蓝牙将 GPS 位置发送到 iOS 设备

ios - swift中的音频播放器没有获得音量和音高的值(value)

ios - .h 文件中的变量与 Objective-C 中的 .m 文件相对

objective-c - SQLite:数据库错误, "out of memory"

ios - 我在 appDelegate 中收到错误?

ios - 在 Google Maps SDK iOS 中的所有其他标记上设置一个标记

ios - UITableview大量图片

c++ - 如何将 wstring 转换为 NSString