iPhone中的应用程序的Document文件夹

| 我正在使用Dropbox API并在应用程序文档文件夹中下载文件。 我可以从文档目录查看表中的文件列表。如何从此表格视图中读取照片或文件? iPhone呢?我们可以直接访问文档文件夹吗?     
已邀请:
这是获取文档目录的最常用方法–
NSArray *searchResults = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [searchResults objectAtIndex:0];

NSString *filePath = [documentsDirectory stringByAppendingPathComponent:fileName];
您可以使用ѭ1来检查目录的内容。您可以查看
contentsOfDirectoryAtPath:error:
方法。     
访问文档文件夹-
NSDictionary *theCatalogInfo=nil;
NSString *theCatalogFilePath = [NSString stringWithFormat:@\"%@/Documents/\",NSHomeDirectory()];
theCatalogFilePath = [theCatalogFilePath stringByAppendingString:@\"File Name\"];
if(nil!=theCatalogFilePath)
{


    theCatalogInfo=[[NSDictionary alloc]initWithContentsOfFile:theCatalogFilePath];

}

return theCatalogInfo;
    

要回复问题请先登录注册