假如对某个对象调用其祖父类实现的函数,会在JPForwardInvocation和JPExecuteORIGForwardInvocation之间无限死循环
猜测_currInvokeSuperClsName是用于解决这个问题的,不过没有生效,应该是键值在各个函数中对不上
解决方法是把
JPForwardInvocation函数中的
_currInvokeSuperClsName[selectorName]
替换为
_currInvokeSuperClsName[JPSelectorName]
并且把callSelector中的
if (superClassName) _currInvokeSuperClsName[selectorName] = superClassName;
[invocation invoke];
if (superClassName) [_currInvokeSuperClsName removeObjectForKey:selectorName];
替换为
if(superClassName) _currInvokeSuperClsName[[NSString stringWithFormat:@"_JPSUPER_%@", selectorName]] = superClassName;
[invocation invoke];
if(superClassName) [_currInvokeSuperClsName removeObjectForKey:[NSString stringWithFormat:@"_JPSUPER_%@", selectorName]];
假如对某个对象调用其祖父类实现的函数,会在JPForwardInvocation和JPExecuteORIGForwardInvocation之间无限死循环
猜测_currInvokeSuperClsName是用于解决这个问题的,不过没有生效,应该是键值在各个函数中对不上
解决方法是把
JPForwardInvocation函数中的
_currInvokeSuperClsName[selectorName]替换为
_currInvokeSuperClsName[JPSelectorName]并且把callSelector中的
替换为