24 #define CPTimerDefaultTimeInterval 0.1 33 CPTimeInterval _timeInterval;
46 + (
CPTimer)scheduledTimerWithTimeInterval:(CPTimeInterval)seconds invocation:(
CPInvocation)anInvocation repeats:(BOOL)shouldRepeat
58 + (
CPTimer)scheduledTimerWithTimeInterval:(CPTimeInterval)seconds target:(
id)aTarget selector:(
SEL)aSelector userInfo:(
id)userInfo repeats:(BOOL)shouldRepeat
70 + (
CPTimer)scheduledTimerWithTimeInterval:(CPTimeInterval)seconds callback:(Function)aFunction repeats:(BOOL)shouldRepeat
82 + (
CPTimer)timerWithTimeInterval:(CPTimeInterval)seconds invocation:(
CPInvocation)anInvocation repeats:(BOOL)shouldRepeat
90 + (
CPTimer)timerWithTimeInterval:(CPTimeInterval)seconds target:(
id)aTarget selector:(
SEL)aSelector userInfo:(
id)userInfo repeats:(BOOL)shouldRepeat
98 + (
CPTimer)timerWithTimeInterval:(CPTimeInterval)seconds callback:(Function)aFunction repeats:(BOOL)shouldRepeat
106 - (id)initWithFireDate:(
CPDate)aDate interval:(CPTimeInterval)seconds invocation:(
CPInvocation)anInvocation repeats:(BOOL)shouldRepeat
113 _invocation = anInvocation;
114 _repeats = shouldRepeat;
125 - (id)initWithFireDate:(
CPDate)aDate interval:(CPTimeInterval)seconds target:(
id)aTarget selector:(
SEL)aSelector userInfo:(
id)userInfo repeats:(BOOL)shouldRepeat
129 [invocation setTarget:aTarget];
130 [invocation setSelector:aSelector];
131 [invocation setArgument:self atIndex:2];
136 _userInfo = userInfo;
144 - (id)initWithFireDate:(
CPDate)aDate interval:(CPTimeInterval)seconds callback:(Function)aFunction repeats:(BOOL)shouldRepeat
151 _callback = aFunction;
152 _repeats = shouldRepeat;
163 - (CPTimeInterval)timeInterval
165 return _timeInterval;
195 [_invocation invoke];
239 var _CPTimerBridgeTimer =
function(codeOrFunction, aDelay, shouldRepeat, functionArgs)
244 if (typeof codeOrFunction ===
"string")
246 theFunction =
function()
248 new Function(codeOrFunction)();
259 theFunction =
function()
261 codeOrFunction.apply(window, functionArgs);
269 aDelay = aDelay | 0.0;
278 if (typeof(window) !==
'undefined')
280 window.setTimeout =
function(codeOrFunction, aDelay)
282 return _CPTimerBridgeTimer(codeOrFunction, aDelay, NO, Array.prototype.slice.apply(arguments, [2]));
285 window.clearTimeout =
function(aTimeoutID)
295 window.setInterval =
function(codeOrFunction, aDelay, functionArgs)
297 return _CPTimerBridgeTimer(codeOrFunction, aDelay, YES, Array.prototype.slice.apply(arguments, [2]));
300 window.clearInterval =
function(aTimeoutID)
302 window.clearTimeout(aTimeoutID);
id invocationWithMethodSignature:(CPMethodSignature aMethodSignature)
A representation of a single point in time.
The main run loop for the application.
CPTimer scheduledTimerWithTimeInterval:callback:repeats:(CPTimeInterval seconds, [callback] Function aFunction, [repeats] BOOL shouldRepeat)
id initWithFireDate:interval:target:selector:userInfo:repeats:(CPDate aDate, [interval] CPTimeInterval seconds, [target] id aTarget, [selector] SEL aSelector, [userInfo] id userInfo, [repeats] BOOL shouldRepeat)
CPRunLoop currentRunLoop()
An object representation of a message.
var CPTimersForTimeoutIDs
A timer object that can send a message after the given time interval.
id initWithFireDate:interval:invocation:repeats:(CPDate aDate, [interval] CPTimeInterval seconds, [invocation] CPInvocation anInvocation, [repeats] BOOL shouldRepeat)
void addTimer:forMode:(CPTimer aTimer, [forMode] CPString aMode)
CompletionHandlerAgent prototype invalidate
id dateWithTimeIntervalSinceNow:(CPTimeInterval seconds)
id initWithFireDate:interval:callback:repeats:(CPDate aDate, [interval] CPTimeInterval seconds, [callback] Function aFunction, [repeats] BOOL shouldRepeat)
CompletionHandlerAgent prototype fire
#define CPTimerDefaultTimeInterval