开发者

file browser in iphone?

开发者 https://www.devze.com 2023-01-21 19:34 出处:网络
I am new to Iphone.Ho开发者_开发技巧w to create file browser in iphone ? I wish to show all the files and folders in the iphone.How to do this?Unless you are on a jailbroken phone, your app can only a

I am new to Iphone.Ho开发者_开发技巧w to create file browser in iphone ? I wish to show all the files and folders in the iphone.How to do this?


Unless you are on a jailbroken phone, your app can only access files within its own "sandbox".

There are three folders your app can access, which contain data specific to your application. Your app will not be able to access file data outside these folders.

With that caveat in mind, you would likely use:

  1. NSFileManager and NSDirectoryEnumerator to build a data source to a table view
  2. UITableView to present the list of files and folders obtained from step 1
  3. UINavigationController to provide a navigation stack for walking through a hierarchy of folders: a stack of UITableView instances

to browse the list of accessible files and folders within your application's sandbox.


If you are producing this for the App Store, I would suggest against exposing such a control even for your application's data. It violates the Human Interface Guidelines and most likely will be rejected.

From the iPad Human Interface Guidelines:

Although iPad applications can allow people to create and manipulate files, this does not mean that people should have a sense of the file system on iPad.

On iPad, there is no application analogous to the Mac OS X Finder, and people should not be asked to interact with files as they do on a computer. In particular, people should not be faced with anything that encourages them to think about file types or locations, such as:

  • An open or save dialog that exposes a file hierarchy
  • Information about the permissions status of files
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号