NSTimer
2015-06-23 14:55
246 查看
/* NSTimer.h Copyright (c) 1994-2014, Apple Inc. All rights reserved. */ #import <Foundation/NSObject.h> #import <Foundation/NSDate.h> @interface NSTimer : NSObject + (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti invocation:(NSInvocation *)invocation repeats:(BOOL)yesOrNo;
NSTimer对象直接加入NSRunloop default循环
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti invocation:(NSInvocation *)invocation repeats:(BOOL)yesOrNo; + (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo; + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo; - (instancetype)initWithFireDate:(NSDate *)date interval:(NSTimeInterval)ti target:(id)t selector:(SEL)s userInfo:(id)ui repeats:(BOOL)rep NS_DESIGNATED_INITIALIZER; - (void)fire; @property (copy) NSDate *fireDate; @property (readonly) NSTimeInterval timeInterval; // Setting a tolerance for a timer allows it to fire later than the scheduled fire date, improving the ability of the system to optimize for increased power savings and responsiveness. The timer may fire at any time between its scheduled fire date and the scheduled fire date plus the tolerance. The timer will not fire before the scheduled fire date. For repeating timers, the next fire date is calculated from the original fire date regardless of tolerance applied at individual fire times, to avoid drift. The default value is zero, which means no additional tolerance is applied. The system reserves the right to apply a small amount of tolerance to certain timers regardless of the value of this property. // As the user of the timer, you will have the best idea of what an appropriate tolerance for a timer may be. A general rule of thumb, though, is to set the tolerance to at least 10% of the interval, for a repeating timer. Even a small amount of tolerance will have a significant positive impact on the power usage of your application. The system may put a maximum value of the tolerance. @property NSTimeInterval tolerance NS_AVAILABLE(10_9, 7_0); - (void)invalidate; @property (readonly, getter=isValid) BOOL valid; @property (readonly, retain) id userInfo; @end
相关文章推荐
- boost 安装(转载)
- 设计原则
- js游戏引擎探索指南之Collie
- GridView实现单选效果
- socket之send与发送区的大小关系
- 日语学习之沪江N3基础 20150623 -5
- UVa 11463 - Commandos
- Maven之生成测试覆盖度的插件cobertura-maven-plugin的使用
- duilib list 获取选中的行ID 获取行数 获取行指针 获取本行索引
- Ubuntu终端常用的快捷键
- 设计模式六大原则(1):单一职责原则
- eclipse-debug时直接进入/不进入/提示进入调试页面修改
- String to Integer (atoi) ***
- UV Toolkit贴图教程甜
- 在java中实现日期类型和字符串类型的转换大全(Date String Timestamp Datetime)
- C++队列实现和队列简介
- duilib list 去掉表头
- LayoutInflater的inflate函数用法详解
- ffmpeg常用基本命令
- Linux进程间通信(IPC)