<tfoot id='ZFqZf'></tfoot>
    <bdo id='ZFqZf'></bdo><ul id='ZFqZf'></ul>

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

  • <legend id='ZFqZf'><style id='ZFqZf'><dir id='ZFqZf'><q id='ZFqZf'></q></dir></style></legend>

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

      2. iOS4 创建后台定时器

        时间:2023-10-03
          <tbody id='X83fc'></tbody>
          <i id='X83fc'><tr id='X83fc'><dt id='X83fc'><q id='X83fc'><span id='X83fc'><b id='X83fc'><form id='X83fc'><ins id='X83fc'></ins><ul id='X83fc'></ul><sub id='X83fc'></sub></form><legend id='X83fc'></legend><bdo id='X83fc'><pre id='X83fc'><center id='X83fc'></center></pre></bdo></b><th id='X83fc'></th></span></q></dt></tr></i><div id='X83fc'><tfoot id='X83fc'></tfoot><dl id='X83fc'><fieldset id='X83fc'></fieldset></dl></div>
          • <bdo id='X83fc'></bdo><ul id='X83fc'></ul>
                <legend id='X83fc'><style id='X83fc'><dir id='X83fc'><q id='X83fc'></q></dir></style></legend>
                • <tfoot id='X83fc'></tfoot>

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

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

                  问题描述

                  我(基本上)需要在 iOS 4 上创建一个后台计时器,它允许我在经过特定时间后执行一些代码.我读过你可以使用一些 [NSThread detachNewThreadSelector:达到目标:withObject:]; 但在实践中它是如何工作的呢?如何确保线程也保留在后台.本地通知对我有用,因为我需要执行代码,而不是通知用户.

                  I (Basically) need to create a background timer on iOS 4 that will allow me to execute some code when a specific amount of time has passed. I have read that you can accomplish this using some [NSThread detachNewThreadSelector: toTarget: withObject:]; but how does that work in practice? How can I ensure that the thread remains in the background also. Local notifications will NOT work for me, as I need to execute code, not notify the user.

                  我们将不胜感激!

                  推荐答案

                  您可以使用这些调用在新线程 (detachNewThred) 中执行带有某些参数 (withObject) 的对象 (toTarget) 的方法 (选择器).

                  You can use those call to execute a method (selector) of an object (toTarget) with some parameter (withObject) in a new thread (detachNewThred).

                  现在,如果您想执行延迟任务,最好的方法可能是 performSelector: withObject: afterDelay:,如果您想在后台运行任务,请调用 detachNewThreadSelector: toTarget: withObject:

                  Now if you want to execute a delayed task may be the best approach is performSelector: withObject: afterDelay: and the if you want to run the task on background call the detachNewThreadSelector: toTarget: withObject:

                  这篇关于iOS4 创建后台定时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何格式化 NSDate? 下一篇:无需下载的远程图像大小

                  相关文章

                  1. <small id='c6M3E'></small><noframes id='c6M3E'>

                    <legend id='c6M3E'><style id='c6M3E'><dir id='c6M3E'><q id='c6M3E'></q></dir></style></legend>
                        <bdo id='c6M3E'></bdo><ul id='c6M3E'></ul>

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