containerURLForSecurityApplicationGroupIdentifier在iOS模拟器上返回nil [英] containerURLForSecurityApplicationGroupIdentifier returns nil on iOS Simulator
问题描述
借助iOS8和扩展,Apple推出了App组容器(此处有更多信息)。
With iOS8 and extensions Apple introduced the App group containers (more info here).
我们通过 NSFileManager
的 containerURLForSecurityApplicationGroupIdentifier:
方法使用它。它适用于AppStore(iOS8和iOS7)的生产。问题是因为我们的团队更新到 Xcode 6.1(6A1052d)
,该方法在模拟器上返回 nil
。
We use it through NSFileManager
's containerURLForSecurityApplicationGroupIdentifier:
method. It works well in production on AppStore (with both iOS8 and iOS7). Problem is since our team updated to Xcode 6.1 (6A1052d)
, the method returns nil
on Simulators.
我们搜索了很多,但我们找不到任何线索。即便如此问题或这个在这里不适用。
We searched a lot but we didn't manage to find any clues. Even this question or this one are not applicable here.
NSFileManager
的 containerURLForSecurityApplicationGroupIdentifier:
方法适用于您的模拟器?有没有办法解决这个问题?
Does NSFileManager
's containerURLForSecurityApplicationGroupIdentifier:
method works on your simulators? Is there any way to fix that?
推荐答案
我能够解决这个问题。文档说
I was able to solve this problem on my side. The documentation says
您的应用必须具有指定应用程序组的com.apple.security.application-groups权利
。 https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/index.html#//apple_ref/occ/instm/NSFileManager/containerURLForSecurityApplicationGroupIdentifier :
在我的应用程序中的某个时刻,我已从我的应用目标/构建设置/代码签名/代码签名权利中删除了权利文件。调试和发布都必须包含YOUR_APP.entitlements文件。我的调试不包括它所以它不适用于模拟器
At some point in my app, I had removed the entitlements file from my app target/build settings/code signing/code signing entitlements . Both debug and release must include YOUR_APP.entitlements file . My debug wasn't including it so it wasn't working on simulator
这篇关于containerURLForSecurityApplicationGroupIdentifier在iOS模拟器上返回nil的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!