iOS Help, how can I get a listing of directories?

mkozz28

macrumors newbie
Original poster
Jan 23, 2012
2
0
Hi,

I would like to build a file browser, where I tell the IPAD to look in this folder and show me the directories and files in it. Any ideas on how I can accomplish this?

Thanks
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,703
4,329
Unless I'm mistaken, you can't.

Apps in iOS are sandboxed so that they may only access their own directories (and a few select directories that the system allows apps to share amoungst each other, like the camera roll.)
 

KnightWRX

macrumors Pentium
Jan 28, 2009
15,046
4
Quebec, Canada
Look into what iOS's implementation of NSFileManager lets you do :

http://developer.apple.com/library/.../NSFileManager_Class/Reference/Reference.html

The NSFileManager class enables you to perform many generic file-system operations and insulates an application from the underlying file system. Most file operations can be performed using the shared file manager object. In iOS and Mac OS X v10.5 and later, you can also create a unique instance of NSFileManager in cases where you want to use a delegate object in conjunction with the file manager.

In Cocoa applications, a file manager object is usually your first interaction with the file system. You use this object to locate, create, copy, and move files and directories. You also use this object to get information about files and directories, such as its size, modification date, and BSD permissions. You can also use a file manager object to change the values of many file and directory attributes.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.