• <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

        how to pause and resume NSTimer in iphone(如何在 iphone 中暂停和恢复 NSTimer)

          • <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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Why does Objective-C use YES/NO macro convention instead of true/false?(为什么 Objective-C 使用 YES/NO 宏约定而不是 true/false?)
                  Is there any difference between bool, Boolean, and BOOL in Objective-C?(Objective-C 中的 bool、Boolean 和 BOOL 之间有什么区别吗?)
                  BOOL to NSString(布尔到 NSString)
                  Set bool property of all objects in the array(设置数组中所有对象的布尔属性)
                  Is comparing a BOOL against YES#160;dangerous?(将 BOOL 与 YES 进行比较是否危险?)
                  Objective-C dictionary inserting a BOOL(插入 BOOL 的 Objective-C 字典)
                    <tbody id='PEbE8'></tbody>
                    <bdo id='PEbE8'></bdo><ul id='PEbE8'></ul>

                  • <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>