简体   繁体   English

为什么我的iOS App的“文档”目录成为文件?

[英]Why my iOS App's Documents directory became a file?

We are developing an iOS app with Enterprise distribution. 我们正在开发带有Enterprise发行版的iOS应用。 It ran well in hundreds of devices, but we found some iOS 6.1.3 devices failed to launch it hours later the first run, because the App's Documents directory became a file ! 它可以在数百个设备上很好地运行,但是我们发现某些iOS 6.1.3设备在首次运行几小时后无法启动,因为App的Documents目录变成了文件!

Our App did nothing special except it was downloading about 80MB MP4 files from a remote HTTP server. 我们的应用程序没有什么特别的,除了它是从远程HTTP服务器下载大约80MB的MP4文件。

I assumed that something wrong when it operated the Documents directory, but so far have little clue to identify what's 'dangerous' usage in our codes. 我假设它在操作Documents目录时出了点问题,但是到目前为止,我们几乎没有任何线索来识别代码中的“危险”用法。

Did you have encountered similar problems? 您是否遇到过类似的问题? How did you fix it? 你怎么修好它的?

Thanks a lot to anybody kindly helping to figure it out. 非常感谢任何帮助解决此问题的人。

What I suggest doing is for your app to test for this when it launches, and if there is a file there, move it to some other place (like the temp folder), then create the Documents directory, then move the file back into that directory with the same name (or change the name). 我建议您做的是让您的应用在启动时对其进行测试,如果其中有文件,请将其移至其他位置(例如temp文件夹),然后创建Documents目录,然后将文件移回该目录中。具有相同名称的目录(或更改名称)。 That will at least prevent your app from stalling. 这至少可以防止您的应用程序停顿。

If you have any means of remote logging, you could bin hex the first 64 bytes of the file and send it to your service for analysis (if you know what's in the file it should help you figure out who created it.) 如果您有任何远程日志记录的方法,则可以将文件的前64个字节装进十六进制,然后将其发送到服务中进行分析(如果您知道文件中包含什么内容,它应该可以帮助您确定是谁创建的。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM