4

I'm attempting to implement some new Siri integrations into my app. I have an old Objective-C header that I've been using on my project as a whole, but now this new Siri Intents target also needs a header. So now I have two objective-c bridging headers, one for the main project and its target, and another for the Siri Intents target.

It's not working like I expected it to. I'm getting the "unresolved use of identifier" error referring to one of the objective-C classes I'm trying to import.

In my build settings for the following:

  • Project: directory for main bridging header
  • Targets:
    • selfTitledTarget: directory for main bridging header
    • SiriIntent: directory for new bridging header

My main bridging header includes all the imports of the new bridging header just to be safe.

I didn't have this problem prior to starting the new Siri implementations. I have another project that is ONLY the Siri implementations and that one works fine, so I'm guessing that my problem is rooted in the fact that I have multiple bridging headers?

LuKenneth
  • 2,197
  • 2
  • 18
  • 41

2 Answers2

3

Project: directory for main bridging header

Targets:

  • selfTitledTarget: directory for main bridging header

  • SiriIntent: directory for new bridging header

That makes no sense. Projects don't have bridging headers; targets do. And their bridging header build settings are not directories; they are files.

So, step one is to make sure you have just two bridging headers, one per target.

After that, I would suggest importing all your Objective-C .h files in both bridging headers. It can't hurt, and it should solve your problems.

Community
  • 1
  • 1
matt
  • 515,959
  • 87
  • 875
  • 1,141
2

It's not the header: one bridging header per target is exactly how this should work.

The problem is that the referenced class isn't being compiled into the intent target. Check the target membership pane in the File Inspector (⌘⌥1) and set the shared source files to be included in all targets where they're needed.

jscs
  • 63,694
  • 13
  • 151
  • 195