I would like to share a class "MyClass" that I added as target to an iPhone project to which I then added a Watch Kit extension target.
Whenever I import the "MyClass" in the Watch Kit extension source code I get:
Undefined symbols for architecture arm64: "_OBJC_CLASS_$_MyClass", referenced from: objc-class-ref in WKMyInterfaceController.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any idea on how to solve this? It seems a linker problem so I guess I have to add the source code of the class MyClass to the linked libraries/headers of the WatchKit Extension app but I am not sure if there is a better way to do it.
You need to select both target for you MyClass.
If you are using objective c then go to your MyClass's .m file and select the target as your watch kit also.
Hope this will help you.
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