Where is #define TARGET_OS_WATCH?

My project no longer seems to have this defined. It gives me an unrecognized symbol for <WKExtensionDelegate>. Looking at Watchkit.h, including WKExtension.h seems to be contingent on having TARGET_OS_WATCH defined. However, I can't seem to find this symbol anywhere. If I make a new project WKExtensionDelegate is defined, but not in my existing project. I'd really prefer not to have to recreate the project, but it looks like it's going to come down to that. Any ideas?

-Owen

Replies

Since you made anther project that works, you may need to start comparing.


Maybe someone who knows exactly will post, but have you looked at the watch extension Build Settings tab in Xcode. Maybe it's controlled by Supported Platforms? Have you been making changes on that page? Also, have you shutdown and restarted Xcode?

I've done most of the obvious. I've even done a multi-file search on the whole directory for "TARGET_OS_WATCH" with no results.

Have looked into this more - but am still puzzled. I looked up where TARGET_OS_WATCH is defined. It's in a header file TargetConditionals.h. In my extension, it's defined as 0, in a brand new project it's defined as 1. Here's the difference: in my project, it uses the TargetConditionals.h file from Simulator - ios 9.2, in the new project, it's using the TargetConditionals.h file from Simulator - watch OS 2.1. Both projects are getting it from /usr/include. Somehow I seemed to have upended my project to use an ios bundle instead of a watch bundle. Does anyone have an idea what flips this switch? Or should I just trash my current project and repopulate a new one with my code?