V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ladevan
V2EX  ›  iPad

关于iPad中的“open in"

  •  
  •   ladevan · 2012-04-11 03:24:02 +08:00 · 4412 次点击
    这是一个创建于 4415 天前的主题,其中的信息可能已经有所发展或是发生改变。
    今天发现iPad上的Adobe Reader有了注释功能,很是高兴。但我发现我在Dropbox中打开一个文件,然后“Open in”到Adobe Reader后进行编辑。我想要达到的效果是希望编辑后的文件能够保存在Dropbox里,但实际上Adobe Reader将Dropbox中的那个文件复制到了自身的文件库里,编辑后的文件是保存上Adobe Reader而没有更新到Dropbox。

    我在想是不是iPad里面处理文件的机制就是这样的,“Open in”都会将原始文件复制到目标应用中,还不是直接打开原始文件?我觉得这样不太合理吧,不符合日常我们用电脑的习惯,用一个应用打开一个文件就是那个文件而不是它的副本。不太明白Apple为什么要这么做,或者是我没理解对?
    5 条回复    1970-01-01 08:00:00 +08:00
    blacktulip
        1
    blacktulip  
       2012-04-11 03:30:50 +08:00
    你的理解是对的,是复制过去。iOS上每个程序都运行在自己的沙盒里,没法访问其它程序的文件。
    GhXst
        2
    GhXst  
       2012-04-11 04:50:19 +08:00 via iPhone
    @blacktulip 我也有些疑问,既然iOS每个程序都是独立的,那这种文件复制是如何完成的?
    ladevan
        3
    ladevan  
    OP
       2012-04-11 05:15:55 +08:00
    @blacktulip 沙盒的目的是保障系统安全,限制应用访问系统的一些东西。但为什么文件操作这些访问也要限制呢,而且也不是访问系统里的东西,只是其它应用的文件。Apple应该对这种访问有一些区分比较好啊
    blacktulip
        4
    blacktulip  
       2012-04-11 05:16:58 +08:00
    我找到 UIDocumentInteractionController 看了下,看的不是很明白,哎,我可能有理解错误,无视我一楼的帖子吧。
    vonsy
        5
    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:
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5511 人在线   最高记录 6547   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 09:37 · PVG 17:37 · LAX 02:37 · JFK 05:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.