访问沙箱外的用户主文件夹
我正在开发一个不会提交到 AppStore 的应用程序,并尝试打开用户使用 Safari 下载管理器下载的文件。
该插件提到所有文件都在 ~/Media/Downloads
中下载。
我尝试过仅使用 NSString 的 stringByExpandingTildeInPath ,但它将映射到应用程序沙箱内的 /Media/Downloads 。
问题是:如何扩展该路径以使其映射到实际文件夹?
谢谢!
I'm working on a app which will not be submitted to the AppStore and am trying to open a file which the user has downloaded using Safari Download Manager.
This plugin mentions all files are downloaded inside ~/Media/Downloads
.
I've tried just using NSString
's stringByExpandingTildeInPath
, but it will map to /Media/Downloads inside the application sandbox.
Question is: how can I tilde-expand that path so it maps to the actual folder?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为“Safari 下载管理器”意味着您已经拥有一部越狱的手机。如果是这样,最简单的方法是安装 iFile 之类的东西并找出路径是什么。
我假设它类似于 /var/mobile/Media/Downloads。然后,您可以做两件简单的事情:
I assume that by "Safari Download Manager" you mean that you already have a jailbroken phone. If so, the easiest way is to just install something like iFile and find out what the path is.
I'm assuming that it's something like /var/mobile/Media/Downloads. Then, there are two easy things you can do:
沙箱不仅是 App Store 提交的必需品,也是设备的一项功能。没有越狱,你就不走运了。
The sandbox isn't just a necessity for App Store submission, it's a feature of the device. Without jailbreaking, you're out of luck.