gpt4 book ai didi

iphone - 如何在不使用 NSTimer 的情况下每 10 秒触发一次方法?

转载 作者:行者123 更新时间:2023-11-28 17:58:23 25 4
gpt4 key购买 nike

我想每 10 秒调用一个方法,但我想使用 NSTimer 以外的东西。我可以用什么来做到这一点?

最佳答案

我知道你说过你不想使用计时器,但只是为了确保你知道使用计时器会有多简单...

[NSTimer scheduledTimerWithTimeInterval:10.0
target:self
selector:@selector(someMethod)
userInfo:nil
repeats:YES];

关于iphone - 如何在不使用 NSTimer 的情况下每 10 秒触发一次方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5705553/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com