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
返回
- 属性