iOS应用程序沙盒目录结构

获取主要目录路径的方式
沙盒目录
NSLog(@"%@",NSHomeDirectory());

MyApp.app
NSLog(@"%@",[[NSBundle mainBundle] bundlePath]);

tmp
NSLog(@"%@",NSTemporaryDirectory());

Documents
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docPath = [paths objectAtIndex:0];
NSLog(@"%@",docPath);

Library
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *libPath = [paths objectAtIndex:0];
NSLog(@"%@",libPath);

 

posted on 2015-10-10 16:37  FKunLam  阅读(139)  评论(0编辑  收藏  举报