NSTimer.CreateTimer 方法

定义

重载

CreateTimer(Double, Action<NSTimer>)
CreateTimer(TimeSpan, Action<NSTimer>)
CreateTimer(Double, Boolean, Action<NSTimer>)
CreateTimer(Double, NSObject, Selector, NSObject, Boolean)

创建以后可以添加到 NSRunLoop 的计时器对象。

CreateTimer(Double, Action<NSTimer>)

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

参数

seconds
Double
action
Action<NSTimer>

返回

适用于

CreateTimer(TimeSpan, Action<NSTimer>)

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

参数

when
TimeSpan
action
Action<NSTimer>

返回

适用于

CreateTimer(Double, Boolean, Action<NSTimer>)

[Foundation.Export("timerWithTimeInterval: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 CreateTimer (double interval, bool repeats, Action<Foundation.NSTimer> block);
static member CreateTimer : double * bool * Action<Foundation.NSTimer> -> Foundation.NSTimer

参数

interval
Double
repeats
Boolean
block
Action<NSTimer>

返回

属性

适用于

CreateTimer(Double, NSObject, Selector, NSObject, Boolean)

创建以后可以添加到 NSRunLoop 的计时器对象。

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

参数

seconds
Double

计时器触发之间的秒数。

target
NSObject

计时器触发时将调用的 对象。

selector
Selector

将在 上 target调用的方法。

userInfo
NSObject

自定义用户信息。

此参数可以为 null

repeats
Boolean

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

返回

属性

适用于