GreedyLazy

Results 1 issues of GreedyLazy

你好,在你的pdf的Message Forward中描述到: > 可以通过重写resolveInstanceMethod:和resolveClassMethod:方法,动态添加未实现的方法。其中第一个是添加实例方法,第二个是添加类方法。这两个方法都有一个BOOL返回值,返回NO则进入消息转发机制。 实际上,不论你返回yes或者no,都会重新搜索一遍是否已经添加了方法,当第二次搜索没有时,才会进入消息转发,具体的源码(objc-723)如下: ``` IMP lookUpImpOrForward(Class cls, SEL sel, id inst, bool initialize, bool cache, bool resolver) { IMP imp = nil; bool triedResolver = NO; runtimeLock.assertUnlocked(); //...