首页 > 其他 > 详细

各种 SDk

时间:2015-11-16 12:33:08      阅读:206      评论:0      收藏:0      [点我收藏+]

计时器:(目标动作)

定义枚举类型

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)方法名????

定义方法

 

各种 SDk

原文:http://www.cnblogs.com/quwujin/p/4968489.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!