Question

I am unknown of file manager in iphone

Can anyone explain the concept of file manager here

thank you

Was it helpful?

Solution

Quoting from the Apple Low-Level File Management Programming Guide

You use an NSFileManager object to perform many generic file-system operations—for example you can:

Create directories and files.

Extract the contents of files (as NSData objects)

Change your current working location in the file system.

Copy, move, and link files and directories.

Remove files, links, and directories.

...

An important point to understand is that your application runs in a "sandbox" - it has access only to its own files, not files created by other applications.

The section on the file system in the iOS Application Programming Guide describes the layout of your application and any files it creates.

For example, here's how you might use NSFileManager to open a file named "Defaults.plist" in your application bundle and read it into an NSData object:

NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Defaults" ofType:@"plist"];

NSData *plistXML = [[NSFileManager defaultManager] contentsAtPath:plistPath];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top