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

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

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

        删除 iPhone 沙箱(文档文件夹)中的所有文件?

        Deleting all the files in the iPhone sandbox (documents folder)?(删除 iPhone 沙箱(文档文件夹)中的所有文件?)

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

          • <tfoot id='3ZklV'></tfoot>
              <bdo id='3ZklV'></bdo><ul id='3ZklV'></ul>

              1. <small id='3ZklV'></small><noframes id='3ZklV'>

                1. 本文介绍了删除 iPhone 沙箱(文档文件夹)中的所有文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  有没有一种简单的方法可以删除我保存在应用程序文档文件夹中的所有文件(图像)?

                  Is there an easy way to delete all the files(images) I saved in the documents folder of the app?

                  推荐答案

                  NSFileManager *fileMgr = [[[NSFileManager alloc] init] autorelease];
                  NSError *error = nil;
                  NSArray *directoryContents = [fileMgr contentsOfDirectoryAtPath:documentsDirectory error:&error];
                  if (error == nil) {
                      for (NSString *path in directoryContents) {
                          NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:path];
                          BOOL removeSuccess = [fileMgr removeItemAtPath:fullPath error:&error];
                          if (!removeSuccess) {
                              // Error handling
                              ...
                          }
                      }
                  } else {
                      // Error handling
                      ...
                  }
                  

                  这篇关于删除 iPhone 沙箱(文档文件夹)中的所有文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  What values should I use for iOS boolean states?(我应该为 iOS 布尔状态使用什么值?)
                  How do I get NSJSONSerialization to output a boolean as true or false?(如何让 NSJSONSerialization 将布尔值输出为真或假?)
                  Is there any difference between bool, Boolean, and BOOL in Objective-C?(Objective-C 中的 bool、Boolean 和 BOOL 之间有什么区别吗?)
                  Set bool property of all objects in the array(设置数组中所有对象的布尔属性)
                  What is the correct way to proceed with this bool?(处理这个布尔值的正确方法是什么?)
                  In Objective-c, safe and good way to compare 2 BOOL values?(在 Objective-c 中,比较 2 个 BOOL 值的安全和好方法?)

                    <tbody id='cctqh'></tbody>
                  • <legend id='cctqh'><style id='cctqh'><dir id='cctqh'><q id='cctqh'></q></dir></style></legend>
                  • <tfoot id='cctqh'></tfoot>

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

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

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