iPhone中应用程序的“文档”文件夹 [英] Application's Document folder in iphone

查看:121
本文介绍了iPhone中应用程序的“文档”文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Dropbox API并在应用程序文档文件夹中下载文件。

I am using dropbox API and downloading file in application document folder.

我能够从文档目录查看表中的文件列表。如何从此表格视图中读取照片或文件?

I am able to view list of files in table from document directory. How can I read photos or file from this table view?

iPhone呢?我们可以直接访问文档文件夹吗?

And what about the iPhone. Can we access document folder directly?

推荐答案

这是获取文档目录的最常用方法–

This is the more commonly used approach to get the documents directory –

NSArray *searchResults = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [searchResults objectAtIndex:0];

NSString *filePath = [documentsDirectory stringByAppendingPathComponent:fileName];

您可以使用 NSFileManager 来检查目录。您可以查看 contentsOfDirectoryAtPath:error:方法。

这篇关于iPhone中应用程序的“文档”文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆