无法从watchOS 2中的设置捆绑中获取值 [英] Unable to get values from settings bundle in watchOS 2

查看:87
本文介绍了无法从watchOS 2中的设置捆绑中获取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有与手表应用程序一起使用的设置包.我正在将我的应用程序迁移到watchOS2.有人知道设置捆绑包应该如何工作吗? iPhone是否会将这些值传输给标准用户默认值或具有共享应用程序组的套件名称的用户默认值?我无法工作,也找不到任何有关设置捆绑软件如何与watchOS 2配合使用的文档.

I have a settings bundles that I use with my watch app. I am migrating my app to watchOS 2. Does anyone know how setting bundles are supposed to work? Does the iPhone transfer the values to a the standard user defaults or to a user defaults with a suite name for a shared app group? I can't get either to work and I can't find any documentation on how setting bundles are supposed to work with watchOS 2.

推荐答案

在Watch OS 2.0中,由于Watch App扩展位于Apple Watch中(而不是像Watch 1.0一样位于iOS App中),因此无法通过用户传输数据默认值,因此您应该改用WatchConnectivity. 如果您有设置包或框架,并且想在AW App扩展程序和iOS APP中使用它,则应将其导入到项目的每个目标中.

In Watch OS 2.0 since the Watch App extension is in the Apple Watch (not in the iOS App as in Watch 1.0) you can't transfer data through user defaults, so you should use instead WatchConnectivity. If you have a settings bundle or a framework and you want to use it in the AW App extension and in the iOS APP, you should import it in every target of your project.

这篇关于无法从watchOS 2中的设置捆绑中获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆