获取沙盒路径的方法

来源:互联网 发布:如何关闭手机数据流量 编辑:程序博客网 时间:2024/06/11 15:46


-(void)viewDidLosad{

[super viweDidLoad]

//第一种获取沙盒的路径方法

NSString *pathStr = NSUserName();

NSString *homePathStr = NSHomeDirectoryForUser(pathStr);

NSLong(@"===%@",homePathStr);


//第二种获取方法

NSString *homePathStr = NSHomeDireDirectory();

NSLong(@"====%@",homePathStr);




//获取document文件路径

NSString *document = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask.YES)[0];

//打印文件夹得路径

NSString *tmpStr = NSTemporaryDirectory();

NSLog(@"tmpStr ==== %@",tmpStr);






}

0 0