문제

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.

도움이 되었습니까?

해결책

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:.

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