NSTimer.CreateScheduledTimer 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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
叫用的方法。
- 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
傳回
- 屬性