我想我的收藏App和我的iPhone應用程序之間建立通信使用新WCSession東西在iOS版9WCSession使用WatchKit 2停止應用程序建立
一切順利加入WCSession到手錶擴展名,但一旦我嘗試添加同樣的東西到我的手機目標應用程序將不再生成並給我這個錯誤。
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_WCSession", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我本將其導入:
#import <WatchConnectivity/WatchConnectivity.h>
,然後試圖調用:
if ([WCSession isSupported])
{
self.session = [WCSession defaultSession];
self.session.delegate = self;
[self.session activateSession];
}
有沒有顯示在Xcode編輯器中的任何錯誤。它只是不會建立。我試圖在模擬器上運行它。
任何想法?
解決了這個問題。謝謝回覆。 –
在「構建階段」中的「與庫鏈接二進制文件」下添加「WatchConnectivity.framework」! –