如何在共享默认值上注册Settings.bundle键

时间:2016-09-08 08:28:09

标签: ios nsuserdefaults ios-app-group

我正在尝试将设置属性与应用相关联。我设法使用 standardUserDefaults 来做到这一点。问题是我的应用程序有扩展名,我需要使用带有SuiteName的共享默认值。





虽然我在共享默认值上使用相同的注册方法,但设置包中更改的属性不会在应用程序中更新。





我想先询问是否可行。如果是这样,实现它的方式如何。




1 个答案:

答案 0 :(得分:1)

将ApplicationGroupContainerIdentifier密钥添加到Settings-Watch软件包的Root.plist文件中。

https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/Settings.html

相关问题