美文网首页
NSObject 的消息转发机制

NSObject 的消息转发机制

作者: 穷小子 | 来源:发表于2020-12-16 11:51 被阅读0次
    截屏2020-12-16 上午11.49.46.png

    Step1

    /// Dynamically provides an implementation for a given selector for a class method.

    • (BOOL)resolveClassMethod:(SEL)sel OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);

    /// Dynamically provides an implementation for a given selector for an instance method

    • (BOOL)resolveInstanceMethod:(SEL)sel OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);

    Step2

    /// Returns the object to which unrecognized messages should first be directed.

    • (id)forwardingTargetForSelector:(SEL)aSelector OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0);

    Step3

    /// Overridden by subclasses to forward messages to other objects.

    • (void)forwardInvocation:(NSInvocation *)anInvocation OBJC_SWIFT_UNAVAILABLE("");

    /// Returns an NSMethodSignature object that contains a description of the method identified by a given selector.

    • (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector OBJC_SWIFT_UNAVAILABLE("");

    相关文章

      网友评论

          本文标题:NSObject 的消息转发机制

          本文链接:https://www.haomeiwen.com/subject/ghungktx.html