First, the method can not find the underlying error principle

1. The default pointer _objc_msgForward_impcache in the first line of lookUpImpOrForward

2. Search globally for _objc_msgForward_impcache in the objC-msG-arm64.s file

3. The __objc_msgForward command is displayed, and __objc_forward_handler is called

4. Search globally for objc_forward_handler in objc-Runtime. mm

Second, method dynamic resolution

1. The resolveMethod_locked function cannot be executedIf it is a class method, first execute resolveClassMethod and then determine (! LookUpImpOrNilTryCache (inST, SEL, CLS)) : resolveInstanceMethod: resolveInstanceMethod: resolveInstanceMethod Because the class method is looked up in the metaclass, and the parent of the root metaclass NSObject is NSObject, the NSObject instance method is looked up again, also verifying isa’s bitmap

2. The resolveMethod_locked function executes the resolveInstanceMethod function3. Look for lookUpImpOrNilTryCache again4. The class method will execute resolveClassMethod

3. Introduction of message forwarding process

What happens if the resolveInstanceMethod is not implemented?

To see the first instrumentObjcMessageSends functionThen search globally for objcMsgLogEnabled and see the write message file in the/TMP /msgSends path

Search for/TMP /msgSends and see a file for msgSends-See there are many ways to do this. Haha… See you next time.