ios 沙盒目录

来源:互联网 发布:大学生网络违法犯罪 编辑:程序博客网 时间:2024/05/15 02:48

1.   NSString *home=NSHomeDirectory();

home NSPathStore2 *@"/Users/afmobi/Library/Developer/CoreSimulator/Devices/4A15DB82-E258-4533-9D86-75B58E3B32DC/data/Containers/Data/Application/EA146C97-2AB3-4EE2-A5DC-D7DF8F2A111D"0x00007f90b3e04320


2.NSString *userName = NSUserName();//与上面相同

  NSString *rootPath =NSHomeDirectoryForUser(userName);

rootPath NSPathStore2 *@"/Users/afmobi/Library/Developer/CoreSimulator/Devices/4A15DB82-E258-4533-9D86-75B58E3B32DC/data/Containers/Data/Application/EA146C97-2AB3-4EE2-A5DC-D7DF8F2A111D"0x00007f90b5d006a0


3.NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);

  NSString *documentsDirectory=[pathsobjectAtIndex:0];

documentsDirectoryNSPathStore2 *@"/Users/afmobi/Library/Developer/CoreSimulator/Devices/4A15DB82-E258-4533-9D86-75B58E3B32DC/data/Containers/Data/Application/EA146C97-2AB3-4EE2-A5DC-D7DF8F2A111D/Documents"0x00007f90b3e08660


用第三种方式直接到Documents

0 0
原创粉丝点击