I have read Apple's message forwarding document and other articles, and it seems that the ObjC runtime will redirect unrecognized messages for the object automatically, and if there is no corresponding selector, it will throw an "unrecognized selector sent to instance" error.
But I have two questions that I cannot explain.
and it seems that the ObjC runtime will redirect unrecognized messages for the object automatically
. "" , forwardInvocation:. , , , .
forwardInvocation:
- ObjC?
, . . Cocoa Cocoa , (NSResponder UIResponder ), "" , " ". , , . , Cocoa , - . , , - ( ).
NSResponder
UIResponder
obj. , obj, SDK
methodSignatureForSelector:
( , NSObject methodSignatureForSelector:
). NSMethodSignature, obj , SDK, .