简体   繁体   English

如何生成一个填充了 app 文件夹中所有文件的 UITableViewController?

[英]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.

相关问题 iphone:如何在应用程序的文档文件夹中获取具有给定扩展名的所有文件的列表? - iphone: how do I obtain a list of all files with a given extension on the app's document folder? 应用程序因数据存储而被拒绝 - 如何让它忽略文件夹中的所有文件? - App rejected because of Data Storage - how do I get it to ignore all of my files in a folder? 在iOS应用上将数百个文件缓存24-48小时:全部在“文档”文件夹中还是在多个文件夹中更好? - Caching hundreds of files on iOS app for 24-48 hours: all in Document folder or better in multiple folders? 如何在iOS上从应用程序的文档文件夹中的一个相册中复制所有照片? - How to copy ALL photos from one photo album my app's document folder on iOS? 从PC上的iPhone App文档文件夹下载创建的文件 - Download created files from iPhone App's document folder on PC 如何在iPhone应用程序中获取UITableViewController的数据 - How to get data for UITableViewController in an iphone app 如何以编程方式将uitableview连接到uitableviewcontroller? - how do i connect a uitableview to a uitableviewcontroller programmatically? 如何将多个文件从资源文件夹复制到文档目录? - How to copy multiple files from resource folder to document directory? iPhone SDK-如何检查文档文件夹中的文件名? - iPhone SDK - How to check files' name in document folder? 如何在应用程序文档文件夹中检查此文件是否在iPhone中 - How to check in application document folder whether this files is or not in iPhone
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM