I'm trying to setup communication between my Watch App and my iPhone App using the new WCSession stuff in iOS 9.
Everything went smoothly adding the WCSession to the watch extension but once I try to add the same thing into my phone target the app will no longer build and gives me this error.
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)
I'm importing it with this:
#import <WatchConnectivity/WatchConnectivity.h>
and then trying to call:
if ([WCSession isSupported])
{
self.session = [WCSession defaultSession];
self.session.delegate = self;
[self.session activateSession];
}
There aren't any errors showing up in the Xcode editor. It just won't build. I'm trying to run it on the simulator.
Any ideas?
Have you added a reference to the WatchConnectivity.framework to your iOS project? It needs to be referenced in both the iOS and watchOS projects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With