網頁

2015年6月25日 星期四

[WatchKit]簡單使用CFNotificationCenter來互相呼叫

為了簡化(也不知道有沒有簡化到XDD)呼叫方法
雖然不能用[NSNotificationCenter]
但還好他的下面可以用 ~[CFNotificationCenter]


在WatchKit中,要與Phone溝通基本上是透過
向AppDelegate發送通知,並呼叫到下面的方法
因為 [NSNotificationCenter defaultCenter] 

對於"Phone端"與"Watch端"是不一樣的接收中心
故無法使用NSNotificationCenter來呼叫 
然而,他的下面(...ㄜ好像是算下面) 
"CFNotificationCenter"卻可以達到我們的目的
接著在Phone端post CFNotification