| 简介 
                          文件处理不能直观地与应用程序进行说明,因此,用于处理文件的主要方法解释如下。请注意,应用程序包只有读取权限,我们不会修改文件。无论如何,我们可以修改应用程序的文件目录。 文件处理的方法 
                          下面列出了用于访问和操作文件的方法的列表中。下面我们就来替换,FilePath2 FILEPATH 和 FilePath1字符串到我们所需的完整的文件路径,以获得所需的动作 检查文件是否存在一个路径中 
                          
                            | NSFileManager *fileManager = [NSFileManager defaultManager];//Get documents directory
 NSArray *directoryPaths = NSSearchPathForDirectoriesInDomains
 (NSDocumentDirectory, NSUserDomainMask, YES);
 NSString *documentsDirectoryPath = [directoryPaths objectAtIndex:0];
 if ([fileManager fileExistsAtPath:@""]==YES) {
 NSLog(@"File exists");
 }
 |  
                          比较两个文件的内容 
                          
                            | if ([fileManager contentsEqualAtPath:@"FilePath1" andPath:@" FilePath2"]) {NSLog(@"Same content");
 }
 |  
                          检查是否可写,可读和可执行 
                          
                            | if ([fileManager isWritableFileAtPath:@"FilePath"]) {NSLog(@"isWritable");
 }
 if ([fileManager isReadableFileAtPath:@"FilePath"]) {
 NSLog(@"isReadable");
 }
 if ( [fileManager isExecutableFileAtPath:@"FilePath"]){
 NSLog(@"is Executable");
 }
 |  
                          移动文件 
                          
                            | if([fileManager moveItemAtPath:@"FilePath1" toPath:@"FilePath2" error:NULL]){
 NSLog(@"Moved successfully");
 }
 |  
                          复制文件 
                          
                            | if ([fileManager copyItemAtPath:@"FilePath1" toPath:@"FilePath2"  error:NULL]) {
 NSLog(@"Copied successfully");
 }
 |  
                          删除文件 
                          
                            | if ([fileManager removeItemAtPath:@"FilePath" error:NULL]) {NSLog(@"Removed successfully");
 }
 |  
                          读取文件  
                          
                            |  NSData *data = [fileManager contentsAtPath:@"Path"]; |  
                          写文件 
                          
                            | [fileManager createFileAtPath:@"" contents:data attributes:nil]; |  
                          接下来是什么? 
                          我们已经成功地了解各种文件访问和操纵技术,现在可以做各种操作文件和使用。 | 
					|  |