iOS消息转发机制

2017-09-15  本文已影响0人  向前Lee

1、本类有机会新增一个方法:

+ (BOOL)resolveClassMethod:(SEL)selOBJC_AVAILABLE(10.5,2.0,9.0,1.0);

+ (BOOL)resolveInstanceMethod:(SEL)selOBJC_AVAILABLE(10.5,2.0,9.0,1.0);

2、备援接受者

- (id)forwardingTargetForSelector:(SEL)aSelectorOBJC_AVAILABLE(10.5,2.0,9.0,1.0);

3、消息转发全流程:swift没法用

- (void)forwardInvocation:(NSInvocation*)anInvocationOBJC_SWIFT_UNAVAILABLE("");

- (NSMethodSignature*)methodSignatureForSelector:(SEL)aSelectorOBJC_SWIFT_UNAVAILABLE("");

+ (NSMethodSignature*)instanceMethodSignatureForSelector:(SEL)aSelectorOBJC_SWIFT_UNAVAILABLE("");

上一篇下一篇

猜你喜欢

热点阅读