zoukankan      html  css  js  c++  java
  • 各种 SDk

    计时器:(目标动作)

    定义枚举类型

    typedef enum : NSUInteger {//enum枚举 integer整型   typedef定义类型
        TimerTypeOnce,
        TimerTypeCircle,
    } TimerType;

    声明方法:+设置目标动作回调

    -(void)startWithType:(TimerType)type Duriation:(double)t;
    -(void)stop;
    -(void)addTarget:(id)target Action:(SEL)action;

    计时器(delegate)

    定义枚举类型+声明协议 protocol

    typedef enum : NSUInteger {
        TimerTypeOnce,
        TimerTypeCircle,
    } TimerType;
    
    @protocol TimerDelegate;

    引用协议+声明方法+实现协议

    @property(nonatomic,weak)id<TimerDelegate>delegate;
    
    -(void)startWithType:(TimerType)type Duriation:(double)t;
    -(void)stop;
    
    @end
    
    @protocol TimerDelegate <NSObject>
    
    -(void)timerDidEnd:(TimerD *)t;

    计时器(Block)

    定义枚举类型+定义Block回调void(^类名)(回调类型)

    typedef enum : NSUInteger {
        TimerTypeOnce,
        TimerTypeCircle,
    } TimerType;
    typedef void(^TB)(void)

    定义类名(strong)方法名????

    定义方法

  • 相关阅读:
    log4j
    JDBCtemplete 模板
    动态代理 aop切面实现事务管理
    spring
    spring mvc 简单实现及相关配置实现
    ssm整合
    Jquery
    Git分布式版本控制系统
    Java web server 基本实现原理
    jvm
  • 原文地址:https://www.cnblogs.com/quwujin/p/4968489.html
Copyright © 2011-2022 走看看