ios沙盒路径

http://www.cnblogs.com/ios-wmm/p/3299695.html

 

iOS沙盒路径的查看和使用

 

 

    NSString *path = NSHomeDirectory();//主目录
    NSLog(@"NSHomeDirectory:%@",path);
    NSString *userName = NSUserName();//与上面相同
    NSString *rootPath = NSHomeDirectoryForUser(userName);
    NSLog(@"NSHomeDirectoryForUser:%@",rootPath);
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory=[paths objectAtIndex:0];//Documents目录
    NSLog(@"NSDocumentDirectory:%@",documentsDirectory);
复制代码
posted @ 2016-02-23 11:03  尘恍若梦  阅读(211)  评论(0编辑  收藏  举报