Reputation: 987
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.
Upvotes: 0
Views: 109
Reputation: 406
You can serialize objects to String, transmit, and deserialize back to the object you need. Probably not the best way, but worked for me.
Upvotes: 0