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

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

        URLForUbiquityContainerIdentifier: 应该在主线程之外的线

        时间:2023-05-31

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

          <tbody id='G8jx7'></tbody>

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

          • <legend id='G8jx7'><style id='G8jx7'><dir id='G8jx7'><q id='G8jx7'></q></dir></style></legend>
              <bdo id='G8jx7'></bdo><ul id='G8jx7'></ul>
                <tfoot id='G8jx7'></tfoot>
                  本文介绍了URLForUbiquityContainerIdentifier: 应该在主线程之外的线程中调用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我已经阅读了很多关于是否应该在主线程之外调用 URLForUbiquityContainerIdentifier: 的相互矛盾的信息.在许多 Apple 的文档中,他们总是大概在主线程上调用此方法.但是,我还了解到调用此方法可能会阻塞很长时间.

                  I've read a lot of conflicting information about whether or not URLForUbiquityContainerIdentifier: should be called outside the main thread or not. In a lot of Apple's documentation they always call this method presumably on the main thread. However, I've also read that it's possible that calling this method could block for a significant time.

                  大家的想法是什么?在主线程中调用它,不用担心,或者是的,总是在另一个线程中调用它?

                  What is everyone's thoughts? Call it in the main thread and don't worry or yes, ALWAYS make this call in another thread?

                  推荐答案

                  NSFileManager 可能会阻塞,建议在与主线程不同的线程上运行.这是使用 Grand Central Dispatch 在不同线程上利用 iCloud Storage 的片段

                  NSFileManager can be blocking and is recommended to run on a different thread than the main thread. Here is a snippet of using Grand Central Dispatch to utilize iCloud Storage on a different thread

                  dispatch_queue_t globalQueue = dispatch_get_global_queue(QUEUE_PRIORITY_DEFAULT, 0);
                  dispatch_async(globalQueue, ^{
                      NSFileManager *fileManager = [[NSFileManager alloc] init];
                      NSURL *ubiquityContainer = [fileManager URLForUbiquityContainerIdentifier:nil];
                  
                      dispatch_queue_t mainQueue = dispatch_get_main_queue();
                      dispatch_async(mainQueue, ^{
                          [self updateWithUbiquityContainer:ubiquityContainer];
                      });
                  });
                  

                  这是来自这里的一篇很棒的文章:

                  This is from a great article located here:

                  http://oleb.net/blog/2011/11/ios5-tech-talk-michael-jurewitz-on-icloud-storage/

                  这篇关于URLForUbiquityContainerIdentifier: 应该在主线程之外的线程中调用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:iOS 如何使用私有 API? 下一篇:在 UIWebView 中启用 Cookie

                  相关文章

                  最新文章

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

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

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

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