共用方式為


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) 之後失效。

傳回

屬性

適用於