美文网首页OC
cancelPreviousPerformRequestsWit

cancelPreviousPerformRequestsWit

作者: json_jie | 来源:发表于2018-01-24 10:46 被阅读2395次
    • (void)performSelector:(SEL)aSelector withObject:(nullable id)anArgument afterDelay:(NSTimeInterval)delay inModes:(NSArray<NSRunLoopMode> *)modes;
    • (void)performSelector:(SEL)aSelector withObject:(nullable id)anArgument afterDelay:(NSTimeInterval)delay

    performSelector N秒钟之后 执行方法

    • (void)cancelPreviousPerformRequestsWithTarget:(id)aTarget selector:(SEL)aSelector object:(nullable id)anArgument;
    • (void)cancelPreviousPerformRequestsWithTarget:(id)aTarget

    cancelPreviousPerformRequestsWithTarget:取消performSelector方法注册过的方法,就是说当上面这个方法正在运行,比如希望5秒钟之后执行某一个方法,但是没到5秒钟的情况下取消performSelector,就是用cancelPreviousPerformRequestsWithTarget方法来实现的

    相关文章

      网友评论

        本文标题:cancelPreviousPerformRequestsWit

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