watchkit,iOS在手表和iphone之间发送数据 [英] watchkit , iOS sending data between watch and iphone

查看:77
本文介绍了watchkit,iOS在手表和iphone之间发送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在手表中创建一个按钮,同时点击手表启动一个进程到我的ios应用程序。如何在2台设备之间发送数据

I want to create one button in watch and while tapping on watch start one process to my ios app. How can I send the data between 2 devices

-(void)viewWillAppear:(BOOL)animated

{
 [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(sayHello:) name: @"sayHelloNotification" object: nil];

}

加上

 [[NSNotificationCenter defaultCenter] postNotificationName: @"sayHelloNotification" object: nil];

在我的按钮表中但不起作用

in my button watch but it doesn't work

推荐答案

AFAIK,您不能直接共享数据,比如在它们之间发送一些数据。

您可以做的是将数据写入同一文件。

AFAIK, you can not share data directly, like send some datas between them.
What you can do is write data to same file.

请参阅此博文:

http://www.atomicbird.com/blog/sharing-with-app-extensions

这篇关于watchkit,iOS在手表和iphone之间发送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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