标签: ios objective-c swift watchkit
我想使用WatchKit连接从iPhone发送对象数组到WatchKit扩展。
我尝试使用sendMessageData,但它只接受NSData。
sendMessageData
NSData
如何在iPhone和WatchKit扩展程序之间共享同一个类?
答案 0 :(得分:1)
You can also use sendMessage(_:replyHandler:errorHandler:) which sends a dictionary of property list values.
sendMessage(_:replyHandler:errorHandler:)
To share the same class between iPhone and Watch Extension just add it to both targets: