• <tfoot id='kgsYi'></tfoot>

      <small id='kgsYi'></small><noframes id='kgsYi'>

      <legend id='kgsYi'><style id='kgsYi'><dir id='kgsYi'><q id='kgsYi'></q></dir></style></legend>
        <bdo id='kgsYi'></bdo><ul id='kgsYi'></ul>
        <i id='kgsYi'><tr id='kgsYi'><dt id='kgsYi'><q id='kgsYi'><span id='kgsYi'><b id='kgsYi'><form id='kgsYi'><ins id='kgsYi'></ins><ul id='kgsYi'></ul><sub id='kgsYi'></sub></form><legend id='kgsYi'></legend><bdo id='kgsYi'><pre id='kgsYi'><center id='kgsYi'></center></pre></bdo></b><th id='kgsYi'></th></span></q></dt></tr></i><div id='kgsYi'><tfoot id='kgsYi'></tfoot><dl id='kgsYi'><fieldset id='kgsYi'></fieldset></dl></div>

        如何在 iphone 中暂停和恢复 NSTimer

        时间:2023-10-03

          • <tfoot id='zYfLu'></tfoot>
          • <small id='zYfLu'></small><noframes id='zYfLu'>

                <bdo id='zYfLu'></bdo><ul id='zYfLu'></ul>

                  <tbody id='zYfLu'></tbody>
                <i id='zYfLu'><tr id='zYfLu'><dt id='zYfLu'><q id='zYfLu'><span id='zYfLu'><b id='zYfLu'><form id='zYfLu'><ins id='zYfLu'></ins><ul id='zYfLu'></ul><sub id='zYfLu'></sub></form><legend id='zYfLu'></legend><bdo id='zYfLu'><pre id='zYfLu'><center id='zYfLu'></center></pre></bdo></b><th id='zYfLu'></th></span></q></dt></tr></i><div id='zYfLu'><tfoot id='zYfLu'></tfoot><dl id='zYfLu'><fieldset id='zYfLu'></fieldset></dl></div>
                <legend id='zYfLu'><style id='zYfLu'><dir id='zYfLu'><q id='zYfLu'></q></dir></style></legend>

                  本文介绍了如何在 iphone 中暂停和恢复 NSTimer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  你好我正在开发小游戏应用程序.当用户转到另一个视图[说设置视图]时,我需要暂停计时器.当用户返回该视图时,我需要恢复计时器.

                  hello I am developing small gameApp. I need to pause the timer,when user goes to another view [say settings view]. when user comes back to that view , I need to resume the timer.

                  谁能解决这个问题...

                  can anybody solve this issue ...

                  在此先感谢...

                  推荐答案

                  你不能暂停计时器.但是,当用户进入设置视图时,您可以保存计时器的 fireDate 以及当前日期.在此之后,您使计时器无效并让用户做他/她的事情.一旦他/她切换回游戏,您创建一个新的计时器对象并将触发日期设置为旧触发日期加上用户在菜单中的时间(oldTime + currentTime).

                  You can't pause a timer. However, when the user goes to the settings view, you can save the fireDate of the timer and also the current date. After this you invalidate the timer and let the user do his/her stuff. Once he/she switches back to the game, you create a new timer object and set the fire date to the old fire date plus the time the user was in the menu (oldTime + currentTime).

                  这篇关于如何在 iphone 中暂停和恢复 NSTimer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:用户按下按钮时如何打开设置应用程序? 下一篇:为什么没有相应 ivar 的子类 @property 隐藏超类 ivar?

                  相关文章

                    <bdo id='PEbE8'></bdo><ul id='PEbE8'></ul>

                1. <i id='PEbE8'><tr id='PEbE8'><dt id='PEbE8'><q id='PEbE8'><span id='PEbE8'><b id='PEbE8'><form id='PEbE8'><ins id='PEbE8'></ins><ul id='PEbE8'></ul><sub id='PEbE8'></sub></form><legend id='PEbE8'></legend><bdo id='PEbE8'><pre id='PEbE8'><center id='PEbE8'></center></pre></bdo></b><th id='PEbE8'></th></span></q></dt></tr></i><div id='PEbE8'><tfoot id='PEbE8'></tfoot><dl id='PEbE8'><fieldset id='PEbE8'></fieldset></dl></div>
                  <tfoot id='PEbE8'></tfoot>

                  <small id='PEbE8'></small><noframes id='PEbE8'>

                  1. <legend id='PEbE8'><style id='PEbE8'><dir id='PEbE8'><q id='PEbE8'></q></dir></style></legend>