通过WatchConnectivity从iOS转移对象到WatchOS

发布于 2025-01-24 20:29:34 字数 434 浏览 5 评论 0原文

我正在尝试将EventKit数据传输到ekcalendars/ekevents/ekreminder通过watchconnectivity从iOS到watchos。

该连接有效,但我无法直接推动这些对象进行响应。我也不能使用nskeyedarachiver,因为ekcalendars(示例)无法将其转换为数据。

因此,是否知道如何将简单的EventKit数据从iOS传输到WatchOS?

另一个提示:我已经在WatchOS中获取了这些数据(因此没有解决方案),但是如果设备具有MDM配置文件,则除了假期日历以外的任何东西,所以我只想测试iPhone是否可以获取更多(因为MDM配置文件存储在iPhone上,而不是在手表上),但我无法传输这些数据槽观看连接性。

I am trying to transfer EventKit Data like EKCalendars / EKEvents / EKReminder from iOS to watchOS via WatchConnectivity.

The connection works but I cannot push these objects directly in response. I also cannot use NSKeyedArchiver since EKCalendars (example) are not able to get converted to Data.

So, any Idea how I can transfer simple EventKit Data from iOS to watchOS?

An additional hint: I am already fetching these data within watchOS (so no solution) but if the device has an MDM profile it cannot fetch anything but the holiday calendar so I just wanted to test if the iPhone can fetch more (since the MDM profile is stored on iPhone, not on watch) but I can't transfer these data trough WatchConnectivity.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

つ可否回来 2025-01-31 20:29:34

您可以将对象序列化以串制,传输和验证回到所需的对象。可能不是最好的方法,但对我有用。

You can serialize objects to String, transmit, and deserialize back to the object you need. Probably not the best way, but worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文