CHDeclareClass(DCTextView);
CHOptimizedMethod1(self, instancetype, DCTextView, initWithFrame, CGRect, frame){
NSLog(@"替换方法3");
return CHSuper1(DCTextView, initWithFrame,frame);
}
CHConstructor{
CHLoadLateClass(DCTextView);
CHClassHook1(DCTextView, initWithFrame);
}
代码是这样的。一直报错,看的怀疑人生了,突然想到instancetype可以写成id,一试,确实成功了。回过头一看,编译错误里面确实有一条Unknown type name 'instancetype'
。
logos倒是没这个问题。
,初进逆向,路还很长。