如何访问沙箱之外的共享目录无法访问

iOS的沙箱目录和文件操作
时间: 00:31:22
&&&& 阅读:65
&&&& 评论:
&&&& 收藏:0
标签:一、沙箱
iOS的每一个应用程序都有自己的目录来存放数据,这个目录称为沙箱目录。沙箱目录是一种数据安全策略,它设计的原理是只能允许自己的应用访问目录,而不允许其他的应用访问,这样可以保证数据的安全,应用之间是不能共享数据的。
一些特有的应用(如通讯录)需要特定的API才能共享数据。
下面简单介绍一下,应用程序的沙箱目录,先直观的看一下演示程序的沙箱目录结构。
该应用程序的沙箱路径为:
/Users/"用户名"/Library/Developer/CoreSimulator/Devices/8DFEE3-B099-18C/data/Containers/Data/Application/E82B708D-B06C-4837-BA59-74EE22CA7BE4
我们可以看到,该沙箱目录有三个子目录,分别为Documents,Library,tmp
1、Documents
该目录用于存储非常大的文件或需要非常频繁更新的数据,能够进行iTunes或iCloud备份。该目录是只有一个元素的数组,因此获取该目录位置的代码如下:
NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
2、Library
该目录下面有&Preferences和Caches两个子目录,Preferences用于存放应用程序的设置数据,能够进行iTunes或iCloud备份;Caches主要用来存放应用的缓存文件,iTunes不会备份。
获取Library目录位置的代码如下:
NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject];
获取Preferences目录位置的代码如下:
NSString *preferencePath = [NSSearchPathForDirectoriesInDomains(NSPreferencePanesDirectory, NSUserDomainMask, YES) lastObject];
获取Caches目录位置的代码如下:
NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];
该目录是用来存放临时文件的,它不能够进行iTunes或iCloud备份。用户可以访问它,获取该目录的代码如下:
NSString *tmpPath = NSTemporaryDirectory();
&二、文件操作
&1、创建文件夹
我们在documents目录下创建test文件夹
NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSLog(@"document文件夹路径为%@",documentPath);
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *testPath = [documentPath stringByAppendingPathComponent:@"test"];
BOOL isSuccess = [fileManager createDirectoryAtPath:testPath withIntermediateDirectories:YES attributes:nil error:nil];
NSLog(@"成功创建文件夹了吗:%@",isSuccess?@"yes":@"no");
2、创建文件
接着上面的代码,我们在test文件夹下创建文件test.txt
NSString *txtPath = [testPath stringByAppendingPathComponent:@"test.txt"];
BOOL isTxtSuccess = [fileManager createFileAtPath:txtPath contents:nil attributes:nil];
NSLog(@"成功创建文件了吗:%@",isTxtSuccess?@"yes":@"no");
可以看到test.txt还是空的,下面我们写入数据。
3、写数据到文件
NSString *testString = @"Hello World??";
BOOL isWriteSuccess = [testString writeToFile:txtPath atomically:YES encoding:NSUTF8StringEncoding error:nil];
NSLog(@"成功写入数据了吗:%@",isWriteSuccess?@"yes":@"no");
4、读取文件
下面我们读取我们刚刚创建的test.txt文件的内容
NSString *readString = [NSString stringWithContentsOfFile:txtPath encoding:NSUTF8StringEncoding error:nil];
NSLog(@"读取到的文件内容为%@",readString);
5、删除文件
BOOL isDeleteSuccess = [fileManager removeItemAtPath:txtPath error:nil];
NSLog(@"成功删除文件了吗:%@",isDeleteSuccess?@"yes":@"no");
&6、计算路径下文件的总大小
+(float)sizeWithFilePath:(NSString *)path
NSFileManager *fileManager = [NSFileManager defaultManager];
BOOL isDirectory = NO;
下面方法返回两个参数
isExist:该路径是否存在
isDirectory:该路径下是否是文件夹
BOOL isExist = [fileManager fileExistsAtPath:path isDirectory:&isDirectory];
if (!isExist)
//如果是文件夹则遍历出文件
if (isDirectory)
//该方法能获得这个文件夹下面的所有子路径(直接/间接子路径)
NSArray *subpaths = [fileManager subpathsAtPath:path];
float totalSize = 0;
for (NSString *subpath in subpaths)
NSString *fullsubpath = [path stringByAppendingPathComponent:subpath];
//判断子路径下是否是文件夹
BOOL isDir = NO;
[fileManager fileExistsAtPath:fullsubpath isDirectory:&isDir];
//子路径下是文件则计算大小
if (!isDir)
NSDictionary *attributes = [fileManager attributesOfItemAtPath:fullsubpath error:nil];
//得到的结果是以B为单位的,除以1024 * 1024
totalSize += [attributes[NSFileSize] floatValue];
NSString *sizeString = [NSString stringWithFormat:@"%.2fMB",totalSize / (1024 * 1024.0)];
NSLog(@"%@",path,sizeString);
return totalSize / (1024 * 1024.0);
NSDictionary *attributes = [fileManager attributesOfItemAtPath:path error:nil];
NSLog(@"%f",path,[attributes[NSFileSize] floatValue] / (1024 * 1024.0));
return [attributes[NSFileSize] floatValue] / (1024 * 1024.0);
7、删除路径下的所有文件
+(void)cleanFileWithFilePath:(NSString *)path
NSLog(@"清除之前文件大小为%.2fMB",[FZYFileManager sizeWithFilePath:path]);
NSFileManager *fileManager = [NSFileManager defaultManager];
dispatch_queue_t globalQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(globalQueue, ^{
NSArray *subpaths = [fileManager subpathsAtPath:path];
for (NSString *subPath in subpaths)
NSString *fullPath = [path stringByAppendingPathComponent:subPath];
if ([fileManager fileExistsAtPath:fullPath])
[fileManager removeItemAtPath:fullPath error:&error];
NSLog(@"清除之后文件大小为%.2fMB",[FZYFileManager sizeWithFilePath:path]);
dispatch_sync(dispatch_get_main_queue(), ^{
[FZYFileManager cleanSuccess];
可以下载相关代码标签:
&&国之画&&&& &&
版权所有 京ICP备号-2
迷上了代码!IOS获取各种文件目录路径的方法
IOS获取各种文件目录路径的方法
iphone沙箱模型有四个文件夹,分别是什么,永久数据存储一般放在什么位置,得到模拟器的路径的简单方式是什么.
documents,tmp,app,Library。
(NSHomeDirectory()),
手动保存的文件在documents文件里
Nsuserdefaults保存的文件在tmp文件夹里
1、Documents 目录:您应该将所有de应用程序数据文件写入到这个目录下。这个目录用于存储用户数据或其它应该定期备份的信息。
2、AppName.app 目录:这是应用程序的程序包目录,包含应用程序的本身。由于应用程序必须经过签名,所以您在运行时不能对这个目录中的内容进行修改,否则可能会使应用程序无法启动。
3、Library 目录:这个目录下有两个子目录:Caches 和 Preferences
Preferences 目录:包含应用程序的偏好设置文件。您不应该直接创建偏好设置文件,而是应该使用NSUserDefaults类来取得和设置应用程序的偏好.
Caches 目录:用于存放应用程序专用的支持文件,保存应用程序再次启动过程中需要的信息。
4、tmp 目录:这个目录用于存放临时文件,保存应用程序再次启动过程中不需要的信息。
获取这些目录路径的方法:
第一种方式:获取家目录路径的函数:
NSString *homeDir = NSHomeDirectory();
第二种方式:获取Documents目录路径的方法:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docDir = [paths objectAtIndex:0];
第三种方式:获取Caches目录路径的方法:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *cachesDir = [paths objectAtIndex:0];
第四种方式:获取tmp目录路径的方法:
NSString *tmpDir = NSTemporaryDirectory();
第五种方式:获取应用程序程序包中资源文件路径的方法:
例如获取程序包中一个图片资源(apple.png)路径的方法:
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@”apple” ofType:@”png”];
UIImage *appleImage = [[UIImage alloc] initWithContentsOfFile:imagePath];
代码中的mainBundle类方法用于返回一个代表应用程序包的对象。
iphone沙盒(sandbox)中的几个目录获取方式:
// 获取沙盒主目录路径&
NSString *homeDir = NSHomeDirectory();
// 获取Documents目录路径&
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docDir = [paths objectAtIndex:0];
// 获取Caches目录路径&
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *cachesDir = [paths objectAtIndex:0];
// 获取tmp目录路径&
NSString *tmpDir = NSTemporaryDirectory();
// 获取当前程序包中一个图片资源(apple.png)路径&
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"apple" ofType:@"png"];
UIImage *appleImage = [[UIImage alloc] initWithContentsOfFile:imagePath];
NSFileManager* fm=[NSFileManager defaultManager];
if(![fm fileExistsAtPath:[self dataFilePath]]){
//下面是对该文件进行制定路径的保存
[fm createDirectoryAtPath:[self dataFilePath] withIntermediateDirectories:YES attributes:nil error:nil];
//取得一个目录下得所有文件名
NSArray *files = [fm subpathsAtPath: [self dataFilePath] ];
//读取某个文件
NSData *data = [fm contentsAtPath:[self dataFilePath]];
NSData *data = [NSData dataWithContentOfPath:[self dataFilePath]];
ios获取文件路径的方法有多种,下面介绍一种IOS中获取文件路径比较简单方法。
网上的DOCUMNET和“教程”真让人越看越糊涂,还是自己记下吧。
首先把文件(比如本例中的testFile.txt文件)放置在resources分组下,然后代码这样写:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"testFile" ofType:@"txt"];
NSLog(@"data path: %@", filePath);
输出的日志中你可以看到testFile.txt的路径已经获得。
再举一个例子:连接SQLITE数据库
NSString *dataPath = [[NSBundle mainBundle] pathForResource:@"myData" ofType:@"sqlite"];
if (sqlite3_open([dataPath UTF8String], &db) != SQLITE_OK)
sqlite3_close(db);
NSLog(@"数据库打开失败");
NSLog(@"数据库成功打开");
以上内容是IOS获取各种文件目录路径的方法,希望对大家有所帮助。
Copyright & 2016 phpStudyios开发入门(12)
& & &对于文件操作来说是开发中的常用模块,这个问题一直困恼了很多天,正好项目有一个模块用到了文件的操作,需求是用(cordova-plugin-file
)插件(访问文件的路径),录制了一小段语音(cordova-plugin-media),需要先存储起来(有默认的存储地址),然后利用(cordova-plugin-file-transfer)插件的方法,把存储中的语音文件获取进行上传,然后进行回应,之后返回结果合成文字,然后再语音播放出来。就是小的智能问答系统。由于android平台下的文件目录系统下能够直接查看,但是在ios
中查看一个应用的目录没那个容易。
& & &我首先尝试使用PP助手来查看但是提示的是要越狱,为了看到文件,直接把touch给越狱了,但是未果在应用列表,选择单个应用,查看文件,结果查看的还是应用外部的文件夹,不如DCIM,Books,AirFair,Airlock,PhotoData 等,根本不是我想要看到的结果,后来又忙活了半天,终于找到了一个正解。
& & &&& 虽然是博主转载的,还是要再次感谢!
下面我列出下插件包cordova-plugin-file里面关于ios 文件系统的支持情况,供大家在遇到的时候有一个参考,基于h5的cordova项目操作源生的文件。摘自README.md文件有如下内容。
## Where to Store Files
As of v1.2.0, URLs to important file-system directories are provided.
Each URL is in the form _file:///path/to/spot/_, and can be converted to a
`DirectoryEntry` using `window.resolveLocalFileSystemURL()`.
* `cordova.file.applicationDirectory` - Read-only directory where the application
& is installed. (_iOS_, _Android_, _BlackBerry 10_, _OSX_, _windows_)
* `cordova.file.applicationStorageDirectory` - Root directory of the application's
& on iOS & windows this location is read-only (but specific subdirectories[like
& `/Documents` on iOS or `/localState` on windows] are read-write). All data contained within
& is private to the app. (_iOS_, _Android_, _BlackBerry 10_, _OSX_)
* `cordova.file.dataDirectory` - Persistent and private data storage within the
& application's sandbox using internal memory (on Android, if you need to use
& external memory, use `.externalDataDirectory`). On iOS, this directory is not
& synced with iCloud (use `.syncedDataDirectory`). (_iOS_, _Android_, _BlackBerry 10_, _windows_)
* `cordova.file.cacheDirectory` -& Directory for cached data files or any files
& that your app can re-create easily. The OS may delete these files when the device
& runs low on storage, nevertheless, apps should not rely on the OS to delete files
& in here. (_iOS_, _Android_, _BlackBerry 10_, _OSX_, _windows_)
* `cordova.file.externalApplicationStorageDirectory` - Application space on
& external storage. (_Android_)
* `cordova.file.externalDataDirectory` - Where to put app-specific data files on
& external storage. (_Android_)
* `cordova.file.externalCacheDirectory` - Application cache on external storage.
& (_Android_)
* `cordova.file.externalRootDirectory` - External storage (SD card) root. (_Android_, _BlackBerry 10_)
* `cordova.file.tempDirectory` - Temp directory that the OS can clear at will. Do not
& rely on the OS to
your app should always remove files as
& applicable. (_iOS_, _OSX_, _windows_)
* `cordova.file.syncedDataDirectory` - Holds app-specific files that should be synced
& (e.g. to iCloud). (_iOS_, _windows_)
* `cordova.file.documentsDirectory` - Files private to the app, but that are meaningful
& to other application (e.g. Office files). Note that for _OSX_ this is the user's`~/Documents` directory. (_iOS_, _OSX_)
* `cordova.file.sharedDirectory` - Files globally available to all applications (_BlackBerry 10_)
### iOS File System Layout
| Device Path& & & & & & & & & & & & & & & & & & | `cordova.file.*`& & & & & & |`iosExtraFileSystems` | r/w? | persistent? | OS clears | sync | private |
|:-----------------------------------------------|:----------------------------|:----------------------|:----:|:-----------:|:---------:|:----:|:-------:|
| `/var/mobile/Applications/&UUID&/` & & & & & & | applicationStorageDirectory | - & & & & & & & & & & | r& & | & & N/A & & | & & N/A & | N/A& | & Yes & |
| &&&`appname.app/` & & & & & & & | applicationDirectory& & & & | bundle& & & & & & & & | r& & | & & N/A & & | & & N/A & | N/A& | & Yes & |
| &&&&&&`www/` & & | - & & & & & & & & & & & & & | - & & & & & & & & & & | r& & | & & N/A & & | & & N/A & | N/A& | & Yes & |
| &&&`Documents/` & & & & & & & & | documentsDirectory& & & & & | documents & & & & & & | r/w& | & & Yes & & | & & No& & | Yes& | & Yes & |
| &&&&&&`NoCloud/` | - & & & & & & & & & & & & & | documents-nosync& & & | r/w& | & & Yes & & | & & No& & | No & | & Yes & |
| &&&`Library`& & & & & & & & & & | - & & & & & & & & & & & & & | library & & & & & & & | r/w& | & & Yes & & | & & No& & | Yes? | & Yes & |
| &&&&&&`NoCloud/` | dataDirectory & & & & & & & | library-nosync& & & & | r/w& | & & Yes & & | & & No& & | No & | & Yes & |
| &&&&&&`Cloud/` & | syncedDataDirectory & & & & | - & & & & & & & & & & | r/w& | & & Yes & & | & & No& & | Yes& | & Yes & |
| &&&&&&`Caches/`& | cacheDirectory& & & & & & & | cache & & & & & & & & | r/w& | & & Yes*& & |& Yes\*\*\*| No & | & Yes & |
| &&&`tmp/` & & & & & & & & & & & | tempDirectory & & & & & & & | - & & & & & & & & & & | r/w& | & & No\*\*& |& Yes\*\*\*| No & | & Yes & |
& \* Files persist across app restarts and upgrades, but this directory can
&& & be cleared whenever the OS desires. Your app should be able to recreate any
&& & content that might be deleted.
\*\* Files may persist across app restarts, but do not rely on this behavior. Files
&& & are not guaranteed to persist across updates. Your app should remove files from
&& & this directory when it is applicable, as the OS does not guarantee when (or even
&& & if) these files are removed.
\*\*\* The OS may clear the contents of this directory whenever it feels it is
&& & necessary, but do not rely on this. You should clear this directory as
&& & appropriate for your application.
& 基于此,大家可以对ios应用的文件目录有一个大致的了解。如果一点基础都没有,大家可以参考之前的文章&
总结:1.对于各个平台的差异性,在相对应的插件中有相关的说明,可以在README.md文件中进行查看,其中还有使用说明,类似于开发的API 这在开发中十分重要!
& & &2.锻炼自己的搜索能力,关键字搜索技巧,要不然,手机越狱了也没有找到。呜呜····
& & &3.对于一些底层的操作,感觉还是用原声的实现比较好,三方插件也可以实现,但是很繁琐(个人认为),目的是简化开发成本,提高效率的,结果走了绕圈的路,算是涨点经验吧。
& & &4.不能完全相信操作使用手册,在实际中发现并非完全正确。或者是没有完完全全搞懂。
比如 摘自上文media的README.me文件:
### iOS Quirks
- __numberOfLoops__: Pass this option to the `play` method to specify
& the number of times you want the media file to play, e.g.:
& & & & var myMedia = new Media(&http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3&)
& & & & myMedia.play({ numberOfLoops: 2 })
- __playAudioWhenScreenIsLocked__: Pass in this option to the
& method to specify whether you want to allow playback when the screen
& is locked.& If set to `true` (the default value), the state of the
& hardware mute button is ignored, e.g.:
& & & & var myMedia = new Media(&http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3&)
& & & & myMedia.play({ playAudioWhenScreenIsLocked : false })
- __order of file search__: When only a file name or simple path is
& provided, iOS searches in the `www` directory for the file, then in
& the application's `documents/tmp` directory:
& & & & var myMedia = new Media(&audio/beer.mp3&)
& & & & myMedia.play()& // first looks for file in www/audio/beer.mp3 then in &application&/documents/tmp/audio/beer.mp3
实际测试中发现是这样子的:
下面是我经过反复测试得到的结果:
&var fileURL = cordova.file.cacheDirectory + recog_
//音频地址& (可能的首选)&
打印log 文件地址file:///var/mobile/Containers/Data/Application/CE28CF34-18B0-46D1-AB1E-31DC28227E3E/Library/Caches/qxj_Chat.wav
var fileURL = cordova.file.applicationStorageDirectory + recog_
//音频地址 (不适用)
打印的log& file:///var/mobile/Containers/Data/Application/F6B713A7-1F-2F5D245E9C3F/qxj_Chat.wav
&var fileURL = cordova.file.dataDirectory + recog_
//音频地址 (不适用)
打印的log 文件地址file:///var/mobile/Containers/Data/Application/963BEF7B-DA2C-4203-A01F-EA2D/Library/NoCloud/qxj_Chat.wav
&var fileURL = cordova.file.syncedDataDirectory + recog_
//音频地址 (不适用)
打印log & 文件地址file:///var/mobile/Containers/Data/Application/CD70862A-D0CB-4DB6-89BC-3FC447D30933/Library/Cloud/qxj_Chat.wav
&var fileURL = cordova.file.documentsDirectory + recog_
//音频地址 (不适用)
& upload error source file:///var/mobile/Containers/Data/Application/EB48A50D-1E5B-4B4D-8B32-BAC/Documents/qxj_Chat.wav
& 而qxj_Chat.wav 就是我想看到的文件,但是路径和说明中的不一样,这也是程序一直报错(没有找到相关的目录和路径)的原因。
题外话:另外附一张源生的应用的沙箱目录,大家可以做一下对比。
& &小结:在Android平台下可以使用这个插件后去路径:
& & & & &var fileURL = cordova.file.externalRootDirectory + recog_ //音频地址 & &是在外存储的根目录下 &recog_src=qxj_Chat.wav
& & & && & & 在IOS平台下可以使用这个插件后去路径:& & & & & & &
& & & &&var fileURL = cordova.file.tempDirectory + recog_//音频地址& //tmp
& & && &文件名字获取如下js代码:& & & & &
& & & fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1); //qxj_Chat.wav
& & 如有不妥之处,欢迎批评指正,共同学习,共同进步!
& & & & & &&
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:43309次
排名:千里之外
原创:41篇
转载:10篇
(3)(1)(5)(21)(10)(5)(3)(1)(2)各平台目录
Application.dataPath : & & & & & & & & & &private/var/Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/Data
Application.streamingAssetsPath : Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/Data/Raw
Application.persistentDataPath : & &Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Documents
Application.temporaryCachePath : Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Library/Caches
Application.dataPath :& /data/app/xxx.xxx.xxx.apk
Application.streamingAssetsPath :& jar:file:///data/app/xxx.xxx.xxx.apk/!/assets
Application.persistentDataPath :& /data/data/xxx.xxx.xxx/files
Application.temporaryCachePath :& /data/data/xxx.xxx.xxx/cache
Application.dataPath : &&&&&&&&&&&&&&&&&&&&&&& /Assets
Application.streamingAssetsPath : & && /Assets/StreamingAssets
Application.persistentDataPath : &&&&&&& C:/Users/xxxx/AppData/LocalLow/CompanyName/ProductName
Application.temporaryCachePath : &&&& C:/Users/xxxx/AppData/Local/Temp/CompanyName/ProductName
Application.dataPath : &&&&&&&&&&&&&&&&&&&&&&& /Assets
Application.streamingAssetsPath : & && /Assets/StreamingAssets
Application.persistentDataPath : &&&&&&& /Users/xxxx/Library/Caches/CompanyName/Product Name
Application.temporaryCachePath : &&&& /var/folders/57/6b4_9w8113x2fsmzx_yhrhvh0000gn/T/CompanyName/Product Name
无论 android或ios我们都可以用Application.persistentDataPath来获取沙箱路径
注意,不要使用Application.dataPath 这个在ios8以前是可读写,但ios8后,只可读不可写
沙箱内目录结构
1 android打包后的apk实际上是jar压缩包,可以用解压缩打开查看
2 ios安装后的沙箱目录
Documents 目录:这个目录用于存储用户数据,iTunes备份和恢复的时候会包括此目录
AppName.app 目录:这是应用程序的程序包目录,包含应用程序的本身。由于应用程序必须经过签名,所以您在运行时不能对这个目录中的内容进行修改,否则可能会使应用程序无法启动。
Library 目录:这个目录下有两个子目录:Caches 和 Preferences
Preferences 目录:包含应用程序的偏好设置文件。您不应该直接创建偏好设置文件,而是应该使用NSUserDefaults类来取得和设置应用程序的偏好.
Caches 目录:存放缓存文件,iTunes不会备份此目录,此目录下文件不会在应用退出删除,保存应用程序再次启动过程中需要的信息。
tmp 目录:这个目录用于存放临时文件,保存应用程序再次启动过程中不需要的信息。有可能在程序退出或设备重启后清空目录,但实测ipad下重启应用或重启设备后并没有清空
iTunes在与iPhone同步时,备份所有的Documents和Library文件。
1 android下审核标准较低,所以不做讨论
2 ios审核时会要求Documents 下文件不可以太多,太大所。以我们要通过审核,这里只保存简单的用户信息,其它游戏信息可以保存在Library /Caches 下,我们可以在Library /Caches 下新建一个userdata目录来保存需要的信息
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:57102次
排名:千里之外
原创:24篇
转载:45篇
(1)(4)(1)(4)(2)(2)(1)(7)(7)(1)(1)(1)(9)(5)(13)(9)(1)

我要回帖

更多关于 iis虚拟目录无法访问 的文章

 

随机推荐