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

      1. <tfoot id='uEw3t'></tfoot>
      2. <small id='uEw3t'></small><noframes id='uEw3t'>

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

        如何隐藏在 ios 的文档目录中创建的文件夹?

        时间:2023-06-01
        • <bdo id='dxHRN'></bdo><ul id='dxHRN'></ul>
          <legend id='dxHRN'><style id='dxHRN'><dir id='dxHRN'><q id='dxHRN'></q></dir></style></legend>

              <tbody id='dxHRN'></tbody>

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

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

                  本文介绍了如何隐藏在 ios 的文档目录中创建的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我以编程方式创建了一些 PDF 文件,我使用以下代码将其存储到设备内存中 >>>>

                  I have created some PDF files programatically, which i am storing into the devices memory using the following code >>>>

                      NSString *fileName = [NSString stringWithFormat:@"SampleTextFile.pdf",strFinalString];
                  
                      NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
                      NSString *saveDirectory = [path objectAtIndex:0];
                      NSString *saveFileName = fileName;
                      NSString *documentPath = [saveDirectory stringByAppendingPathComponent:saveFileName];
                  

                  我可以在 Devices Document 文件夹中看到该文件.

                  I can see the file in the Devices Document folder.

                  我想隐藏这些文件,让用户看不到或删除它.

                  I want to hide these files so that the user can not see or delete it.

                  谁能帮我做这件事.

                  推荐答案

                  存储私有数据的好地方是~/Library/Application Support/,这是Mac上使用的文件夹这个目的.

                  A good place to store private data is in ~/Library/Application Support/, which is the folder used on the Mac for this purpose.

                  您可以使用以下方法生成此文件夹的路径:

                  You can generate a path to this folder using:

                  NSString *appSupportDir = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) firstObject];
                  

                  您必须在第一次使用它时自己创建文件夹,您可以这样做:

                  You'll have to create the folder yourself the first time you use it, which you can do with:

                  if (![[NSFileManager defaultManager] fileExistsAtPath:appSupportDir])
                  {
                      [[NSFileManager defaultManager] createDirectoryAtPath:appSupportDir withIntermediateDirectories:YES attributes:nil error:NULL];
                  }
                  

                  我编写了一个简单的库,使这个和所有其他有用的 iOS 文件夹可用作 NSFileManager 上的方法:https://github.com/nicklockwood/StandardPaths

                  I wrote a simple library that makes this and all other useful iOS folders available as methods on NSFileManager: https://github.com/nicklockwood/StandardPaths

                  这篇关于如何隐藏在 ios 的文档目录中创建的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:iOS 5:使 NSString 类别包括 NSCFConstantString? 下一篇:如何以编程方式使铃声静音或更改 iOS5 上的铃声

                  相关文章

                  最新文章

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

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

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

                      <legend id='lE6Kp'><style id='lE6Kp'><dir id='lE6Kp'><q id='lE6Kp'></q></dir></style></legend>

                      <tfoot id='lE6Kp'></tfoot>