iOS中Category方法调用Category方法,调用不到原类方法,如何调用原类方法
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
- (void)beginRefresh
{
u_intcount =0;
MethodcurrentMethod =nil;
Method*methods =class_copyMethodList(self.class, &count);
for(inti=count-1; i>0; i--) {
if(method_getName(methods[i]) ==_cmd) {
currentMethod = methods[i];
break;
}
}
((void(*)(id,SEL))method_getImplementation(currentMethod))(self,method_getName(currentMethod));
}
#pragma clang diagnostic pop
网友评论