今天简单研究一下iOS的重定向消息forwardInvocation:

  首先看看Invocation类:

@interface NSInvocation : NSObject {
@private
    __strong void *_frame;
    __strong void *_retdata;
    id _signature;
    id _container;
    uint8_t _retainedArgs;
    uint8_t _reserved[15];
}

+ (NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)sig;

- (NSMethodSignature *)methodSignature;

- (void)retainArguments;
- (BOOL)argumentsRetained;

- (id)target;
- (void)setTarget:(id)target;

- (SEL)selector;
- (void)setSelector:(SEL)selector;

- (void)getReturnValue:(void *)retLoc;
- (void)setReturnValue:(void *)retLoc;

- (void)getArgument:(void *)argumentLocation atIndex:(NSInteger)idx;
- (void)setArgument:(void *)argumentLocation atIndex:(NSInteger)idx;

- (void)invoke;
- (void)invokeWithTarget:(id)target;

@end
NSInvocation

相关文章:

  • 2022-12-23
  • 2021-11-02
  • 2021-09-26
  • 2022-12-23
  • 2021-09-25
  • 2022-02-08
  • 2022-12-23
猜你喜欢
  • 2021-08-23
  • 2022-12-23
  • 2021-07-20
  • 2021-12-05
  • 2021-10-21
  • 2022-01-01
相关资源
相似解决方案