简体   繁体   English

远程位置和本地iPhone设备上的iCloud文档路径 - 以编程方式查找

[英]iCloud document path at remote place and on local iPhone device - finding programmatically

1.I need to attach a text file named "document.doc" of iCloud to my configured mail id on my iPhone "programmatically" 1.我需要在我的iPhone上“以编程方式”将iCloud的名为“document.doc”的文本文件附加到我配置的邮件ID

  1. What is the absolute path for icloud stored document with app ID is this file://localhost/private/var/mobile/Mobile documents/appId.com.companyname.appname/Documents/document.doc 具有应用程序ID的icloud存储文档的绝对路径是这个文件:// localhost / private / var / mobile / Mobile documents / appId.com.companyname.appname / Documents / document.doc

if this is the path when I try to find the number of files in Documents under appId it's showing 0. 如果这是我尝试在appId下的Documents中找到文件数时的路径,则显示0。

  1. do iCloud documents stored in a local path when they opened? 打开时存储在本地路径中的iCloud文档? if so what is the exact absolute path of that local storage. 如果是这样,那么本地存储的确切绝对路径是什么。 I need to find this because I have to send the icloud document as an attachment programmatically 我需要找到这个,因为我必须以编程方式将icloud文档作为附件发送

Yes, iCloud documents are stored locally in your app's container in the Mobile Documents folder. 是的,iCloud文档存储在Mobile Documents文件夹中的应用程序容器中。

Is this a document that your app created? 这是您的应用创建的文档吗? If so, you should use the methods Apple provides (namely, -URLForUbiquityContainerIdentifier: ) to find out what the correct path is. 如果是这样,您应该使用Apple提供的方法(即-URLForUbiquityContainerIdentifier:来找出正确的路径。 You should not hard-code it as it might change over time. 您不应该对其进行硬编码,因为它可能会随着时间而改变。

If this file is in another app's container, then you're out of luck, since the sandbox won't let you access another app's files. 如果此文件位于另一个应用程序的容器中,那么您运气不好,因为沙箱不允许您访问其他应用程序的文件。 (This might be why you're getting zero files there). (这可能就是你在那里获得零文件的原因)。

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

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