Mac App Store 沙盒 - 写入新文件?
我一直在玩一个想要提交到 Mac App Store 的应用程序,其部分功能就是简单地抓取用户通过拖动或打开选择的文件,并将其修改后的文件保存到与原始文件相同的目录中文件(但具有不同的文件名)。
我不想使用“保存”对话框,因为这会破坏我正在构建的应用程序的实用性,但看起来这可能是允许应用程序在沙盒要求下编写的唯一方法将文件作为新文件复制到磁盘上的任意位置(在本例中为任意位置,与现有文件位于同一文件夹中)。
有什么方法可以在不禁用沙箱的情况下解决这个问题吗?另外,如果我今天提交的应用程序没有打开权利/沙盒,它会得到苹果的批准吗(假设它通过了所有其他要求),还是他们已经拒绝了非沙盒应用程序?
I've been playing around with an app I want to submit to the Mac App Store, and part of the functionality is simply grabbing a file the user chose by dragging or opening, and saving a modified of it to the same directory as the original file (but with a different file name).
I don't want to use a 'Save' dialog box, as that destroys the utility of the application I'm building, but it looks like that might be the only way the app would be allowed—under sandboxing requirements—to write a file to an arbitrary location (arbitrary, in this case, being in the same folder as the existing file) on the disk as a new file.
Is there any way I can approach this without disabling sandboxing? Also, if I submit the app without entitlements/sandboxing turned on today, will it be approved by Apple (supposing it passes all the other requirements), or are they already turning down non-sandboxed apps?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于你的第一个问题,不,我不相信有任何方法可以写入用户未指定的文件,除非它位于你的应用程序的容器中,或者(从 10.7.3 开始)位于你有一个目录中安全范围的 URL。请参阅文档 这里。如果用户指定一个文件,我怀疑您是否获得了封闭文件夹的权限,但值得一试。
回答你的第二个问题,截至今天,即 2012 年 4 月 27 日星期五,App Store 不再需要沙箱。给出的最新截止日期是2012 年 6 月 1 日。
For your first question, no, I don't believe there is any way to write to a file the user didn't specify, unless it's either in your app's container, or (as of 10.7.3) in a directory you have a security-scoped URL for. See the documentation here. If the user specifies a file, I doubt you get permissions to the enclosing folder, but it's worth a shot.
Answering your second question, as of today, Friday April 27th, 2012, the App Store does not require sandboxing. The latest deadline given was June 1, 2012.