1

I must have started from scratch about 4 times already. I've followed the solutions listed below but I still have an issue (which I think has something to do with the bridging header file). Note: I have tried manually creating the bridging header as well as the automated solution Xcode offers when you drag some Objective-C files into a Swift project.

Swift Bridging Header import issue

Connect Objective C framework to Swift iOS 8 app (Parse framework)

Here are the main errors I am seeing. I've tried moving the header file up a level/down a level and it still claims to not see it. Everything is currently where Xcode put it when I selected "Yes" when prompted to created the bridging header automatically. You can also see the full contents of my bridging header.enter image description here First error

Second error

Default values

Community
  • 1
  • 1
Johnny Gamez
  • 241
  • 5
  • 19

1 Answers1

0

The "Cannot find protocol declaration for NSObject" error usually refers to circular references problems.

I'm wondering why you put all those standard Apple frameworks in the bridging header? This might be the problem. This special file is supposed to "bridge" Swift and Objective C worlds together, so if you've already referenced and linked your app against those frameworks in your Swift code, you shouldn't need to do it again in the bridging header.

Try to remove all Apple-provided frameworks from your bridging header and only leave the specific ones (IBM....h), and see if it works?

If it doesn't, then start with Foundation/Foundation.h only...

Romain
  • 3,608
  • 2
  • 27
  • 47
  • I've tried leaving only the IBM header files in the bridging header and it does reduce the number of errors, but the error remaining is where I actually begin(or attempt) to use the framework... it doesn't see it. Leaving only `Foundation/Foundation.h` doesn't work either. – Johnny Gamez Feb 16 '15 at 16:54
  • By "start with `Foundation/Foundation.h`", I meant "start by removing only this one", not the opposite. If you try not to use the bridging error (e.g., without importing anything from Objective C), what kind of errors does Xcode produce? Are these the same errors, or new ones? – Romain Feb 16 '15 at 17:01