nstimer

    1热度

    1回答

    我遵循this答案给出的建议。还是我的计时器是有时不nil func recreateTimer(){ let timerLog = OSLog(subsystem: "LocationLogger", category: "Timer") guard shouldUseTimer == true else { os_log("we are using C

    0热度

    1回答

    Crazylytics发生了崩溃。 Crashed: com.apple.main-thread 0 libobjc.A.dylib 0x197e37bdc objc_msgSend + 28 1 Foundation 0x1881192c8 -[NSCFTimer initWithFireDate:interval:target:selector:userInfo:repe

    1热度

    3回答

    昨天,我问,因为我的计时器在后台有问题,我找到了一个解决方案,使其工作,但现在,当我的应用程序进入后台时遇到问题。在后台 运行: backgroundTaskIdentifier = UIApplication.shared.beginBackgroundTask(expirationHandler: { UIApplication.shared.endBackgroundTask(s

    1热度

    1回答

    如何运行例如本地通知? 在UNUserNotificationCenter中没有重复功能。 也许使用NSTimer或类似的东西? 为什么如我所料 let hours: [Int] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24] for hour in hours { for minute i

    0热度

    1回答

    我想停止此计时器,然后从停止它的位置重新启动计时器。 secondsTimer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(addSeconds), userInfo: nil, repeats: true) 下面,有人建议我不应该增加在我的定时器处理程序定时器。为什么不? 例如,使用G

    -1热度

    1回答

    我有NSTimer和动作它。但是我想在第一次5秒之后,第二次4秒之后打电话行动 ...。 _timepast = 6; self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(handleDelay) userInfo:nil repeats:YES]; -(void)han

    1热度

    1回答

    我有一个包含Timer对象的可重用函数countDown(seconds: Int)。功能takeRest()调用countDown(seconds: Int)函数并在调用后立即打印:“测试文本”。我想要做的是等待执行打印功能,直到countDown(seconds: Int)函数中的定时器停止执行并保持countDown()函数可重用。有什么建议么? private func takeRest(

    0热度

    2回答

    我的倒数计时器不想从60倒数计时出现问题,并在达到0时重置。目前它只是将其标签设置为0,并开始倒计数到-1,2 -...我如何在iOS上使用xcode从60开始? .m文件 #import "ViewController.h" @interface ViewController() { int timeTick; NSTimer *timer; } @end @

    1热度

    1回答

    我有5个计时器以不同的时间间隔运行。所有这些计时器都调用相同的函数。 在某个时间,一个或多个计时器函数试图访问相同的方法,这会使我的应用程序崩溃。 我如何为这个特定场景实现NSOperation队列。 感谢您的帮助。

    0热度

    2回答

    我想将剩余的分钟数存储到我的类中的变量中。 已经实现setter方法到类,做工是否精细 我需要每1分钟1后降低计数。 如何将这种递归添加到我的类中的setter方法?