简体   繁体   English

我可以在iOS设备上访问共享容器的内容吗?

[英]Can I access the contents of a shared container on my iOS device?

How can we see the contents of the shared app group container of my iOS application on my iPad. 我们如何在iPad上查看我的iOS应用程序的共享应用程序组容器的内容。 I have tried locating the app container from the Organizer, but the shared app group container (of identifier group.com.company.xxx) was not there in the directory contents. 我尝试从管理器中找到应用程序容器,但是目录内容中没有共享的应用程序组容器(标识符为group.com.company.xxx)。

Example code for generating URL for stored container: 用于为存储的容器生成URL的示例代码:

NSURL *containerURL = [[NSFileManager defaultManager]
                       containerURLForSecurityApplicationGroupIdentifier:@"group.com.me.myapp"];

NSURL *storeURL = [containerURL URLByAppendingPathComponent:@"data.sqlite"];

You code should be like this. 您的代码应该是这样的。

NSURL *containerURL = [[NSFileManager defaultManager]
                       containerURLForSecurityApplicationGroupIdentifier:@"group.com.me.myapp"];

NSString *storeURL = [[containerURL path] stringByAppendingPathComponent:@"data.sqlite"];

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

相关问题 调试 iOS 应用时如何查看 App Group Shared Container 目录的内容? - How can I view the contents of the App Group Shared Container directory when debugging an iOS app? 如何在iOS设备列表中删除iOS设备? - How can I Delete an iOS device on my iOS Device list? 是否可以在iOS中访问设备容器? - Is it possible to get access to device container in iOS? 如何在Xcode 9的iOS设备上运行我的App? - How I can run my App on my iOS device in Xcode 9 ? 锁定iOS设备后,如何启用对NSURLCredentials的访问? - How can I enable access of NSURLCredentials when an iOS Device is locked? AWS device-farm iOS XCTest UI 套件无法访问主应用程序的容器 - AWS device-farm iOS XCTest UI suite can't access main app's container 我可以从同一WiFi网络上的另一台iOS设备访问iOS设备的“文档”目录吗? - Can I access Documents directory of an iOS device from another iOS device on same wifi network? iOS:我的iPhone应用程序可以访问iPhone设备/设备的信任存储区的受信任CA证书吗? - iOS: Can my iPhone app access trusted CA certificates of the iPhone device / device's trust store? 我无法使用提示应用程序连接ios设备 - I can't use the prompt app to connect my ios device 如何从NSData上保存iOS设备上的图像? - How can I save an image on my iOS device from NSData?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM