People.m 398 B

12345678910111213141516171819202122232425262728
  1. //
  2. // People.m
  3. // objc-test
  4. //
  5. // Created by huangyirong on 2020/4/3.
  6. //
  7. #import "People.h"
  8. #import <objc/message.h>
  9. @implementation People
  10. -(void)run{
  11. NSLog(@"执行了该方法");
  12. }
  13. -(void)run2{
  14. }
  15. +(BOOL)resolveInstanceMethod:(SEL)sel{
  16. NSLog(@"HHH");
  17. class_addMethod(self, sel, (IMP)mysel, "v@:");
  18. return [super resolveInstanceMethod:sel];
  19. }
  20. void mysel(){
  21. }
  22. @end