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

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

        <tfoot id='Lum4j'></tfoot>
        <legend id='Lum4j'><style id='Lum4j'><dir id='Lum4j'><q id='Lum4j'></q></dir></style></legend>

        在 iOS 中获取有关时区更改的通知

        时间:2023-05-31
        <i id='7McHT'><tr id='7McHT'><dt id='7McHT'><q id='7McHT'><span id='7McHT'><b id='7McHT'><form id='7McHT'><ins id='7McHT'></ins><ul id='7McHT'></ul><sub id='7McHT'></sub></form><legend id='7McHT'></legend><bdo id='7McHT'><pre id='7McHT'><center id='7McHT'></center></pre></bdo></b><th id='7McHT'></th></span></q></dt></tr></i><div id='7McHT'><tfoot id='7McHT'></tfoot><dl id='7McHT'><fieldset id='7McHT'></fieldset></dl></div>

          <tbody id='7McHT'></tbody>
        <legend id='7McHT'><style id='7McHT'><dir id='7McHT'><q id='7McHT'></q></dir></style></legend>

        <tfoot id='7McHT'></tfoot>

              <small id='7McHT'></small><noframes id='7McHT'>

                  <bdo id='7McHT'></bdo><ul id='7McHT'></ul>
                • 本文介绍了在 iOS 中获取有关时区更改的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我的应用程序可以在设备时区更改时收到任何通知吗?我想在我的应用程序处于前台时收到通知.NSTimezone 对我不起作用,因为我必须不断检查时区.

                  can my application get any notification when device timezone changed? I want to get a notification when my application is foreground. NSTimezone does not worked for me as i have to continuously check for timezone.

                  推荐答案

                  UIApplicationDelegate 有一个名为 applicationSignificantTimeChange: 的方法,当时间发生重大变化时会调用该方法.

                  UIApplicationDelegate has a method called applicationSignificantTimeChange: that gets called when there is a significant change in the time.

                  文档中列出的示例是:

                  重大时间变化的示例包括午夜的到来、运营商的时间更新以及夏令时的变化

                  Examples of significant time changes include the arrival of midnight, an update of the time by a carrier, and the change to daylight savings time

                  但我认为时区变化算作重大的时间变化.

                  But I would assume that timezone changes count as a significant time change.

                  文档还说,如果在您的应用处于后台时发生时间变化,您将在您转到前台时得到它

                  The docs also say that if the time change happens when your app is in the background you will get it when you go to the foreground

                  如果您的应用程序当前处于挂起状态,则此消息将排队等待您的应用程序返回到前台,此时它会被传递.

                  If your application is currently suspended, this message is queued until your application returns to the foreground, at which point it is delivered.

                  您还可以侦听要发布的 UIApplicationSignificantTimeChangeNotification 以在您应用的其他任何地方获取相同的信息.

                  You can also listen for UIApplicationSignificantTimeChangeNotification to be posted to get the same information anywhere else in your app.

                  这篇关于在 iOS 中获取有关时区更改的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:防止 iCloud 同步数据(使用 .nosync?) 下一篇:以编程方式添加时模糊 UILabel

                  相关文章

                  最新文章

                    <bdo id='1vrt9'></bdo><ul id='1vrt9'></ul>
                  <tfoot id='1vrt9'></tfoot>
                • <legend id='1vrt9'><style id='1vrt9'><dir id='1vrt9'><q id='1vrt9'></q></dir></style></legend>

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

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