Class: CADisplayLink
Overview
A CADisplayLink object is a timer object that allows your application to synchronize its drawing to the refresh rate of the display.
Instance Attribute Summary (collapse)
-
- duration
readonly
The time interval between screen refresh updates.
-
- frameInterval
The number of frames that must pass before the display link notifies the target again.
-
- paused
A Boolean value that states whether the display link’s notifications to the target are suspended.
-
- timestamp
readonly
The time value associated with the last frame that was displayed.
Class Method Summary (collapse)
-
+ displayLinkWithTarget:selector:
Returns a new display link.
Instance Method Summary (collapse)
-
- addToRunLoop:forMode:
Registers the display link with a run loop.
-
- invalidate
Removes the display link from all run loop modes.
-
- removeFromRunLoop:forMode:
Removes the display link from the run loop for the given mode.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Attribute Details
- (CFTimeInterval) duration (readonly)
The time interval between screen refresh updates. (read-only) The value for duration is undefined before the target’s selector has been called at least once. Your application can calculate the amount of time it has to render each frame by multiplying duration by frameInterval.
- (Integer) frameInterval
The number of frames that must pass before the display link notifies the target again. The default value is 1, which results in your application being notified at the refresh rate of the display. If the value is set to a value larger than 1, the display link notifies your application at a fraction of the native refresh rate. For example, setting the interval to 2 causes the display link to fire every other frame, providing half the frame rate.Setting this value to less than 1 results in undefined behavior and is a programmer error.
- (Boolean) paused
A Boolean value that states whether the display link’s notifications to the target are suspended. The default value is NO. If YES, the display link does not send notifications to the target.
- (CFTimeInterval) timestamp (readonly)
The time value associated with the last frame that was displayed. (read-only) The target should use the value of this property to calculate what should be displayed in the next frame.
Class Method Details
+ (CADisplayLink) displayLinkWithTarget(target, selector:sel)
Returns a new display link. The selector to be called on the target must be a method with the following signature:where sender is the display link returned by this method.The newly constructed display link retains the target.
Instance Method Details
- (Object) addToRunLoop(runloop, forMode:mode)
Registers the display link with a run loop. You can associate a display link with multiple input modes. While the run loop is executing in a mode you have specified, the display link notifies the target when new frames are required.The run loop retains the display link. To remove the display link from all run loops, send an invalidate message to the display link.
- (Object) invalidate
Removes the display link from all run loop modes. Removing the display link from all run loop modes causes it to be released by the run loop. The display link also releases the target.
- (Object) removeFromRunLoop(runloop, forMode:mode)
Removes the display link from the run loop for the given mode. The run loop releases the display link if it is no longer associated with any run modes.