关于iPad中的“open in"

2012-04-11 03:24:02 +08:00
 ladevan
今天发现iPad上的Adobe Reader有了注释功能,很是高兴。但我发现我在Dropbox中打开一个文件,然后“Open in”到Adobe Reader后进行编辑。我想要达到的效果是希望编辑后的文件能够保存在Dropbox里,但实际上Adobe Reader将Dropbox中的那个文件复制到了自身的文件库里,编辑后的文件是保存上Adobe Reader而没有更新到Dropbox。

我在想是不是iPad里面处理文件的机制就是这样的,“Open in”都会将原始文件复制到目标应用中,还不是直接打开原始文件?我觉得这样不太合理吧,不符合日常我们用电脑的习惯,用一个应用打开一个文件就是那个文件而不是它的副本。不太明白Apple为什么要这么做,或者是我没理解对?
4422 次点击
所在节点    iPad
5 条回复
blacktulip
2012-04-11 03:30:50 +08:00
你的理解是对的,是复制过去。iOS上每个程序都运行在自己的沙盒里,没法访问其它程序的文件。
GhXst
2012-04-11 04:50:19 +08:00
@blacktulip 我也有些疑问,既然iOS每个程序都是独立的,那这种文件复制是如何完成的?
ladevan
2012-04-11 05:15:55 +08:00
@blacktulip 沙盒的目的是保障系统安全,限制应用访问系统的一些东西。但为什么文件操作这些访问也要限制呢,而且也不是访问系统里的东西,只是其它应用的文件。Apple应该对这种访问有一些区分比较好啊
blacktulip
2012-04-11 05:16:58 +08:00
我找到 UIDocumentInteractionController 看了下,看的不是很明白,哎,我可能有理解错误,无视我一楼的帖子吧。
vonsy
2012-04-11 09:08:50 +08:00
每个程序有自己的目录(Documents,Library,tmp...)
程序(Reader)可以注册支持的文件类型.然后另一程序(Dropbox)可以将文件发送给它

个人理解,不对请指正.
----------------------------

The App Sandbox

http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheiOSEnvironment/TheiOSEnvironment.html

Registering the File Types Your App Supports

https://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html#//apple_ref/doc/uid/TP40010411-SW1
To declare its support for file types, your app must include the CFBundleDocumentTypes key in its Info.plistproperty list file. (See “Core Foundation Keys”.) The system adds this information to a registry that other apps can access through a document interaction controller.

UIDocumentInteractionController
UIDocumentInteractionControllerDelegate - documentInteractionController:willBeginSendingToApplication:

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/31929

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX