4 ms·
If you're talking about Objective-C: it doesn't crash. It sends the message -forwardInvocation: to the receiver. (Nowadays it might try a couple of other thi
by mpweiher 9y ago
If you're talking about Objective-C: it doesn't crash. It sends the message -forwardInvocation: to the receiver. (Nowadays it might try a couple of other things first).
Now the default implementation of -forwardInvocation: raises an exception, which in turn is by default unhandled and therefore goes to the default exception handler which logs and terminates.
However, you can implement your own behavior at every level:
1. Override -forwardInvocation: for your own objects (or one of the other mechanisms)
2. Override -forwardInvocation: in NSObject
3. Handle the exception
4. Install your own default exception handler