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

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

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

        • <bdo id='aFwFl'></bdo><ul id='aFwFl'></ul>

      2. 了解 applicationSignificantTimeChange:

        Understanding applicationSignificantTimeChange:(了解 applicationSignificantTimeChange:)

        • <small id='lQmaa'></small><noframes id='lQmaa'>

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

                <tbody id='lQmaa'></tbody>

            1. <legend id='lQmaa'><style id='lQmaa'><dir id='lQmaa'><q id='lQmaa'></q></dir></style></legend>
            2. <tfoot id='lQmaa'></tfoot>
                <bdo id='lQmaa'></bdo><ul id='lQmaa'></ul>

                • 本文介绍了了解 applicationSignificantTimeChange:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我发现有时我的应用程序(Cocos2d 游戏)在经过重大时间更改后会以错误"的方式运行.例如:

                  I find that sometimes my application (Cocos2d game) beheaves in a "buggy" way after a significant time change. For example:

                  • 案例1:当应用进入后台,几分钟后重启,我可以看到加载图片,然后应用/游戏恢复.
                  • 案例 2: 当应用程序进入后台并在很长一段时间后更改应用程序有时会重新启动,有时不会.我仍然不清楚为什么.
                  • case 1: when the application enters the background and, after several minutes, I restart it, I can see the loading image and then the application/game resumes.
                  • case 2: when the application enters the background and after a significant time change the application sometimes restarts, sometimes not. It is still unclear to me why.

                  查看我发现的 AppDelegate 方法:

                  Looking at the AppDelegate methods I found:

                  // next delta time will be zero
                  -(void) applicationSignificantTimeChange:(UIApplication *)application
                  {
                      [[CCDirector sharedDirector] setNextDeltaTimeZero:YES];
                  }
                  

                  我想知道,因为这会影响导演,而导演会影响动画,所以此调用与案例 1 和案例 2 之间是否存在联系?

                  推荐答案

                  这与cocos2D或applicationSignificantTimeChange:

                  特别是对于 applicationSignificantTimeChange:

                  当日期改变时调用此方法,或者如果设备的时间因任何原因在后台发生更改(例如更改时区).
                  [来源]

                  This method is called when the day changes, or if the device's time has been changed in the background for whatever reason (such as changes to time zone).
                  [Source]

                  我假设您提到的重大时间变化"只是您离开游戏一段时间(即超过几分钟).在这种情况下,您很可能会观察到 当设备内存不足时操作系统多任务处理程序会终止后台进程,从而导致您的应用程序按照您在案例 2 中的描述重新启动.

                  I am assuming the "significant time change" you mention is just when you leave the game for a while (i.e. longer than a few minutes). In this case, it's most likely that you are observing the fact that the OS multitasking handler kills off background processes when the device is running low on memory, causing your app to restart as you describe in case 2.

                  在应用程序没有重新启动的情况下,这只是操作系统没有杀死你的进程的情况.

                  In the cases where the app hasn't restarted, it's just the case that the OS hasn't killed your process.

                  这篇关于了解 applicationSignificantTimeChange:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Resume game cocos2d(恢复游戏 cocos2d)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)

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

                          <tbody id='0Jwly'></tbody>
                          <bdo id='0Jwly'></bdo><ul id='0Jwly'></ul>

                          <legend id='0Jwly'><style id='0Jwly'><dir id='0Jwly'><q id='0Jwly'></q></dir></style></legend>