Edit

Share via


NSTimer.CreateScheduledTimer Method

Definition

Overloads

CreateScheduledTimer(Double, NSObject, Selector, NSObject, Boolean)

Creates a timer with the specified parameters and schedules it for execution on the current NSRunLoop in the default mode.

CreateScheduledTimer(Double, Boolean, Action<NSTimer>)
CreateScheduledTimer(Double, Action<NSTimer>)
CreateScheduledTimer(TimeSpan, Action<NSTimer>)

CreateScheduledTimer(Double, NSObject, Selector, NSObject, Boolean)

Creates a timer with the specified parameters and schedules it for execution on the current NSRunLoop in the default mode.

[Foundation.Export("scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:")]
public static Foundation.NSTimer CreateScheduledTimer (double seconds, Foundation.NSObject target, ObjCRuntime.Selector selector, Foundation.NSObject userInfo, bool repeats);
static member CreateScheduledTimer : double * Foundation.NSObject * ObjCRuntime.Selector * Foundation.NSObject * bool -> Foundation.NSTimer

Parameters

seconds
Double

The number of seconds between firings of the timer.

target
NSObject

An object that will be invoked when the timer fires.

selector
Selector

The method to invoke on target.

userInfo
NSObject

Custom user info for the timer.

This parameter can be null.

repeats
Boolean

Whether this timer should repeat automatically (true) or will be invalidated after firing the first time (false).

Returns

Attributes

Applies to

CreateScheduledTimer(Double, Boolean, Action<NSTimer>)

[Foundation.Export("scheduledTimerWithTimeInterval:repeats:block:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.WatchOS, 3, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 10, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 12, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 10, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static Foundation.NSTimer CreateScheduledTimer (double interval, bool repeats, Action<Foundation.NSTimer> block);
static member CreateScheduledTimer : double * bool * Action<Foundation.NSTimer> -> Foundation.NSTimer

Parameters

interval
Double
repeats
Boolean
block
Action<NSTimer>

Returns

Attributes

Applies to

CreateScheduledTimer(Double, Action<NSTimer>)

public static Foundation.NSTimer CreateScheduledTimer (double seconds, Action<Foundation.NSTimer> action);
static member CreateScheduledTimer : double * Action<Foundation.NSTimer> -> Foundation.NSTimer

Parameters

seconds
Double
action
Action<NSTimer>

Returns

Applies to

CreateScheduledTimer(TimeSpan, Action<NSTimer>)

public static Foundation.NSTimer CreateScheduledTimer (TimeSpan when, Action<Foundation.NSTimer> action);
static member CreateScheduledTimer : TimeSpan * Action<Foundation.NSTimer> -> Foundation.NSTimer

Parameters

when
TimeSpan
action
Action<NSTimer>

Returns

Applies to