NSFileManager
[self.fileManagerfileExistsAtPath:isDirectory:];
用于执行一般的文件系统操作 (reading and writing is done via NSData, et. al.).
主要功能包括:从一个文件中读取数据;向一个文件中写入数据;删除文件;复制文件;移动文件;比较两个文件的内容;测试文件的存在性;读取/更改文件的属性... ...<wbr><br><span style="line-height:25px">Just alloc/init an instance and start performing operations. Thread safe.</span><br><br><ul style="line-height:25px; margin-top:5px; margin-right:0px; margin-bottom:5px; margin-left:40px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; border-top-width:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; list-style-type:none; list-style-position:initial"><li style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:30px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; border-top-width:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; list-style-type:disc; list-style-position:initial"> 常见的<strong>NSFileManager处理<span style="word-wrap:normal; word-break:normal; line-height:21px; background-color:rgb(255,255,0)">文件</span>的方法</strong>如下:</li></ul> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66066; word-wrap:normal; word-break:normal; line-height:21px">NSFileManager</span><span style="word-wrap:normal; word-break:normal; line-height:21px"></span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">*</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">=</span><span style="word-wrap:normal; word-break:normal; line-height:21px"></span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[[</span><span style="color:#66066; word-wrap:normal; word-break:normal; line-height:21px">NSFileManager</span><span style="word-wrap:normal; word-break:normal; line-height:21px">alloc</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">]</span><span style="word-wrap:normal; word-break:normal; line-height:21px">init</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span><span style="word-wrap:normal; word-break:normal; line-height:21px"></span><span style="color:#8800; word-wrap:normal; word-break:normal; line-height:21px">//最好不要用defaultManager。</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66066; word-wrap:normal; word-break:normal; line-height:21px">NSData</span><span style="word-wrap:normal; word-break:normal; line-height:21px"></span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">*</span><span style="word-wrap:normal; word-break:normal; line-height:21px">myData</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">=</span><span style="word-wrap:normal; word-break:normal; line-height:21px"></span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager contentsAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span><span style="word-wrap:normal; word-break:normal; line-height:21px"></span><span style="color:#8800; word-wrap:normal; word-break:normal; line-height:21px">// 从一个文件中读取数据</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager createFileAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path contents</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">myData attributes</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">dict</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span><span style="color:#8800; word-wrap:normal; word-break:normal; line-height:21px">//向一个文件中写入数据,属性字典允许你制定要创建</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager removeItemAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path error</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">err</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager moveItemAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path toPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path2 error</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">err</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager copyItemAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path toPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path2 error</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">err</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager contentsEqualAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path andPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path2</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager fileExistsAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">...</span><span style="word-wrap:normal; word-break:normal; line-height:21px"></span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">...</span></pre> <ul style="line-height:25px; margin-top:5px; margin-right:0px; margin-bottom:5px; margin-left:40px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; border-top-width:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; list-style-type:none; list-style-position:initial"><li style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:30px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; border-top-width:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; list-style-type:disc; list-style-position:initial"> 常见的<strong>NSFileManager处理<span style="word-wrap:normal; word-break:normal; line-height:21px; background-color:rgb(255,255,0)">目录</span>的方法</strong>如下:</li></ul> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager currentDirectoryPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager changeCurrentDirectoryPa<wbr>th</wbr></span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager copyItemAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path toPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path2 error</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">err</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager createDirectoryAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path withIntermediateDirector<wbr>ies</wbr></span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">YES attributes</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="color:#0088; word-wrap:normal; word-break:normal; line-height:21px">nil</span><span style="word-wrap:normal; word-break:normal; line-height:21px">error</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">err</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager fileExistsAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path isDirectory</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">YES</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span></pre> <pre style="line-height:25px; white-space:normal; word-wrap:break-word; padding-top:2px; padding-right:2px; padding-bottom:2px; padding-left:2px; border-top-width:1px; border-right-width:1px; border-bottom-width:1px; border-left-width:1px; border-top-style:solid; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; border-top-color:rgb(136,136,136); border-right-color:rgb(136,136,136); border-bottom-color:rgb(136,136,136); border-left-color:rgb(136,136,136)"><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">[</span><span style="word-wrap:normal; word-break:normal; line-height:21px">fileManager enumeratorAtPath</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">:</span><span style="word-wrap:normal; word-break:normal; line-height:21px">path</span><span style="color:#66660; word-wrap:normal; word-break:normal; line-height:21px">];</span><span style="word-wrap:normal; word-break:normal; line-height:21px"></span><span style="color:#8800; word-wrap:normal; word-break:normal; line-height:21px">//获取目录的内容列表。一次可以枚举指定目录中的每个文件。</span><span style="color:#8800; word-wrap:normal; word-break:normal; line-height:21px">... ...</span></pre> <span style="line-height:25px">Has a delegate with lots of “should” methods (to do an operation or proceed after an error).</span><br><span style="line-height:25px">And plenty more. Check out the documentation.</span></wbr>
1、文件的创建
| -(IBAction) CreateFile { //对于错误信息 NSError *error; // 创建文件管理器 NSFileManager *fileMgr = [NSFileManager defaultManager]; //指向文件目录 NSString *documentsDirectory= [NSHomeDirectory() stringByAppendingPathCom<wbr><wbr>ponent:@"Documents"];</wbr></wbr> [[NSFileManager defaultManager]<wbr><wbr><wbr><wbr><wbr>createDirectoryAtPath: [NSString stringWithFormat:@"</wbr></wbr></wbr></wbr></wbr>%@/myFolder", NSHomeDirectory()] attributes:nil]; // File we want to create in the documents directory我们想要创建的文件将会出现在文件目录中 // Result is: /Documents/file1.txt结果为:/Documents/file1.txt NSString *filePath= [documentsDirectory stringByAppendingPathCom<wbr><wbr>ponent:@"file2.txt"];</wbr></wbr> //需要写入的字符串 NSString *str= @"iPhoneDeveloper Tips\nhttp://iPhoneDevelopTips,com"; //写入文件 [str writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:&error]; //显示文件目录的内容 NSLog(@"Documentsdirectory:<wbr></wbr>%@",[fileMgr<wbr>contentsOfDirectoryAtPat<wbr><wbr>h:documentsDirectory error:&error]);<br> }<wbr></wbr></wbr></wbr></wbr> | |
<wbr></wbr>
2、对文件重命名<wbr></wbr>
| 对一个文件重命名 想要重命名一个文件,我们需要把文件移到一个新的路径下。下面的代码创建了我们所期望的目标文件的路径,然后请求移动文件以及在移动之后显示文件目录。 //通过移动该文件对文件重命名 NSString *filePath2= [documentsDirectory stringByAppendingPathCom<wbr><wbr>ponent:@"file2.txt"];<br></wbr></wbr>//判断是否移动 if ([fileMgr moveItemAtPath:filePath toPath:filePath2 error:&error] != YES) NSLog(@"Unable to move file: %@", [error localizedDescription]); //显示文件目录的内容 NSLog(@"Documentsdirectory: %@", [fileMgr contentsOfDirectoryAtPat<wbr><wbr>h:documentsDirectoryerror:&error]);</wbr></wbr> | |
<wbr><wbr></wbr></wbr>
3、删除一个文件<wbr></wbr>
| 这些示例能教你的,仅仅只是文件处理上的一些皮毛。想要获得更全面、详细的讲解,你就需要掌握NSFileManager文件的知识。 | |
<wbr><wbr></wbr></wbr>
4、删除目录下所有文件<wbr></wbr>
| //获取文件路径 NSString *document = [NSSearchPathForDirectori<wbr><wbr>esInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];</wbr></wbr> NSString *path = [document stringByAppendingPathCom<wbr><wbr>ponent:@"Attchments"];</wbr></wbr> [manager createDirectoryAtPath:path withIntermediateDirector<wbr><wbr>ies:NO attributes:nil error:nil];</wbr></wbr> } }<wbr></wbr> --清除附件 |
NSString<wbr>*filePath = [<span style="color:#b92e9f; word-wrap:normal; word-break:normal; line-height:21px">self</span><wbr><span style="color:#32595d; word-wrap:normal; word-break:normal; line-height:21px">dataFilePath</span>];</wbr></wbr>
if<wbr>([[</wbr>NSFileManager<wbr></wbr>defaultManager]fileExistsAtPath:filePath])<wbr></wbr>
{
<wbr><wbr>//do some thing</wbr></wbr>
}
附:
<wbr></wbr>
-(NSString<wbr>*)dataFilePath</wbr>
{
NSArray<wbr>*paths =<wbr></wbr></wbr>NSSearchPathForDirectori<wbr>esInDomains<span style="color:#000000; word-wrap:normal; word-break:normal; line-height:21px">(</span>NSDocumentDirectory<span style="color:#000000; word-wrap:normal; word-break:normal; line-height:21px">,<wbr></wbr></span>NSUserDomainMask<span style="color:#000000; word-wrap:normal; word-break:normal; line-height:21px">,<wbr></wbr></span><span style="color:#b92e9f; word-wrap:normal; word-break:normal; line-height:21px">YES</span><span style="color:#000000; word-wrap:normal; word-break:normal; line-height:21px">);</span></wbr>
NSString<wbr>*documentDirectory = [paths<wbr><span style="color:#3e217e; word-wrap:normal; word-break:normal; line-height:21px">objectAtIndex</span>:<span style="color:#2c32d3; word-wrap:normal; word-break:normal; line-height:21px">0</span>];</wbr></wbr>
return<wbr>[documentDirectory<wbr></wbr></wbr>stringByAppendingPathCom<wbr>ponent<span style="color:#000000; word-wrap:normal; word-break:normal; line-height:21px">:<span style="color:#cf2b23; word-wrap:normal; word-break:normal; line-height:normal"><span style="color:#77482e; word-wrap:normal; word-break:normal; line-height:21px">@</span>"data.plist"</span>];</span></wbr>
}
<wbr></wbr>
本文详细介绍了NSFileManager的基本用法,包括文件和目录的操作方法,并提供了实用的代码示例。同时,还深入探讨了NSFileHandle的使用技巧,帮助开发者更好地进行文件读写。
6820

被折叠的 条评论
为什么被折叠?



