我已启用应用程序组并创建了一个名为“group.com.classData”的组

我的代码如下所示:
let plistPath3 = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.com.classData")
print(plistPath3) //returns "nil"
Run Code Online (Sandbox Code Playgroud)
它返回零。为什么会发生这种情况?
我在开发共享扩展时遇到了这个错误。事实证明,虽然我已将应用程序组权利添加到app\xe2\x80\x99s目标,但我没有将 \xe2\x80\x99t 将其添加到扩展\xe2\x80\x99s目标。我需要从项目/目标下拉列表中选择扩展:
\n\n\n\n然后我单击“功能”选项卡并启用“应用程序组”。我为该应用程序创建的应用程序组已在列表中;我只需要选中它的复选框。当我再次运行该应用程序时,containerURL(forSecurityApplicationGroupIdentifier:)返回一个非零值。
| 归档时间: |
|
| 查看次数: |
2351 次 |
| 最近记录: |