[英]How do generate a UITableViewController that is filled with all the files in the app document folder?
My app is saving certain files.我的应用程序正在保存某些文件。 I need to be able to load the files up and show in a UITableViewController.
我需要能够加载文件并在 UITableViewController 中显示。
Thanks谢谢
You can query the Documents folder and then use that to populate a table view.您可以查询 Documents 文件夹,然后使用它来填充表格视图。
To get the contents of a directory (and perform other file operations), you can use the NSFileMananger class.要获取目录的内容(并执行其他文件操作),您可以使用NSFileMananger class。 Specifically, look into the
contentsOfDirectoryAtPath:Error
method and the similar ones.具体来说,查看
contentsOfDirectoryAtPath:Error
方法和类似的方法。
Essentially, what you want to do is to store those results in an array or collection and then display them in the table view.本质上,您要做的是将这些结果存储在数组或集合中,然后将它们显示在表格视图中。 You can use the standard UITableViewDelegate and data source methods.
您可以使用标准的 UITableViewDelegate 和数据源方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.