user26691
user26691

Reputation: 77

Swallow doesnotrecognizeselector exception from an NSInvocation forwardInvocation call

I have an object which is forwarding receiving messages. It does not implement forwarding them to other objects using forwardInvocation. However, methodSignatureForSelector will not always return a valid method signature at certain times because of the way the program is organized. How can I swallow the exception generated from the missing method signature? Overriding doesNotRecognizeSelector does not work. Thanks.

Upvotes: 2

Views: 566

Answers (1)

newacct
newacct

Reputation: 122489

You must generate some signature (even if a dummy one, e.g. v@:, a signature of a method that returns void and takes no arguments) and then remember to do nothing when it gets to forwardInvocation:.

Upvotes: 5

Related Questions