lundi 11 mai 2015

Sharing classes between existing iPhone project and Watch Kit extension

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.

Aucun commentaire:

Enregistrer un commentaire