NSTimer.CreateScheduledTimer 方法

定义

重载

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

创建具有指定参数的计时器,并计划它在默认模式下在当前 NSRunLoop 上执行。

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

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

创建具有指定参数的计时器,并计划它在默认模式下在当前 NSRunLoop 上执行。

[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

参数

seconds
Double

计时器触发之间的秒数。

target
NSObject

一个对象,将在计时器触发时调用。

selector
Selector

要对 target调用的方法。

userInfo
NSObject

计时器的自定义用户信息。

此参数可以为 null

repeats
Boolean

此计时器是应自动重复 (true) ,还是在首次触发 (false) 后失效。

返回

属性

适用于

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

参数

interval
Double
repeats
Boolean
block
Action<NSTimer>

返回

属性

适用于

CreateScheduledTimer(Double, Action<NSTimer>)

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

参数

seconds
Double
action
Action<NSTimer>

返回

适用于

CreateScheduledTimer(TimeSpan, Action<NSTimer>)

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

参数

when
TimeSpan
action
Action<NSTimer>

返回

适用于