NSBundle
can give you your absolute path in the system.
NSString
(or NSURL
) has methods for working with paths.
NSFileManager
allows you to move, copy, delete (…) files.
This is how you get path to your Data
directory:
NSString *dataDir = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Data"];
// "/var/private/Application/.../YourApp.app/Data"
Now you just append multiple directory names to dataDir
using the same method above and you should get any path you want.
In case you don't know the exact path and you want to scan the directory, you will have to use :
NSArray *dataDirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:dataDir error:nil]
// "file1.data", "file2.data", ...
Then it's all about appending path components.