开发者

Concept of file manager in iphone

I am 开发者_StackOverflowunknown of file manager in iphone

Can anyone explain the concept of file manager here

thank you


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];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜