After successfully using my Xcode created Objective-C bridging header Xcode now returns a Swift Compiler error complaining that the bridging header does not exist.
I had been able to use the Xcode created bridging header all day yesterday before Xcode generated this error when the project was compiling. I have attempted to resolve the issue with the solutions here but have been unable to resolve the issue.
Any suggestions?
Thanks in advance.
I moved my project location and Xcode (v 6.4 ) still looked for the bridging header in the old folder location which was weird. The only way I fixed it was by using an absolute path to the bridging header (#Aggressor's solution of just dragging the file into the bridging header field populated the field with an absolute path) . Really hoping that later version of Xcode fix this - it seems like a stupid IDE bug to me...
Also ensure to check your project Tests target (if you have one) and do the same there
Related
Recently added first swift file to large obj-c project. Compile and run in simulator is fine. Attempt to compile and run for a device and I get a file not found error on the obj-c compiler generated swift header file (aka Objective-C Generated Interface Header Name ending with -swift.h)
I have confirmed (at least to my knowledge) that project settings are correct and can see the file in the (derived data) file system for debug / simulator builds but nothing else.
Have looked at this and this but have not helped. Using xCode8 GM
The problem corrected itself when I
Did a clean (have done many times before)
Built for "Generic" iOS device (success)
Closed and restarted Xcode
Built for Device
go figure..
[Edit] and if this doesn't help .. try this post I just found for more ideas
Was trying to implement some Obj-C code into my Swift 2 project and decided that I was going to try a different method.
I deleted the files I added, including the newly created bridging header.
I went to build settings and removed the contents of the "Objective-C Bridging Header" setting and now I am getting bombarded with errors.
My project was running fine with no errors prior to the Obj-C fiasco.
Can someone help? See attached image for the errors I am getting.
According to the errors, your swift files (profileVeedVC.swift) still refer to the obj-c code. Remove the pod from your podfile and remove any references within the files.
Good luck!
I've read a bunch of articles on adding a Swift bridging header to an Obj-c project:
Apple's docs
Bohemian Polymorph
SwiftCast
Using CocoaPods 0.36, I should see the Swift Compiler sections appear in Build Settings but they aren't? I search in the box for Swift or Bridging and nothing shows up. And I can't add a new Swift file to the project in this situation because I'm writing some reusable installation steps for a project (having the end user create a blank swift file and delete it after the fact is pretty janky).
What's the proper way to manually add a bridging header and configure the Build settings when using CocoaPods? What am I missing?
Bonus Points: I'm ultimately going to be scripting this. If you have an idea of how to do it programmatically, that's even better!
I have a an issue when trying to compile my project.
I have a standalone swift project. It works PERFECTLY.
I added it to an objective-c project (as a plugin). It also works perfectly.
My swift code has no problem what so ever.
Today I needed to change some behaviour in the app delegate file. So I needed to call some of my Swift code in there.
To do this I imported the "ProjectName-Swift.h" file that xcode generates.
No problem so far, it lets me call my Swift code with autocomplete.
However when I go to build I get an error:
Cannot find protocol declaration for 'PHPhotoLibraryChangeObserver'
The file this occurs in, is of course the PumpUp-Swift.h file. I don't create this, Xcode does. Do you know how I can fix this issue given that I can't edit this file?
I downloaded Scintilla, built and ran ScintillaTest. That worked (almost) fine. Now, I want to include Scintilla in a new project, but can't seem to figure out how to. I tried ctrl-clicking my target and selecting Add Existing Framework..., then Add Other... and finally file located at scite337/scintilla/cocoa/ScintillaFramework/build/Release/Scintilla.framework (obviously I omitted the first part of the path).
After I did this I just added an #import statement in the AppDelegate of my further untouched new project. Upon hitting Cmd+R it says ScintillaView.h: no such file or directory...
I thought that if I added the framework to my only target it would pass the location of the header files to the compiler (and preprocessor). Obviously it doesn't, so I assume I'll have to add the paths of the header files (and maybe other files) to the Build Settings, but there are lots of Build Settings, so I don't have a clue where.
If you don't have access to XCode 3.2.x, please leave how you'd do it in a newer version. I've found a lot of information on other XCode matters for higher versions did that work well in XCode 3.2.5 too (with a little bit of searching for menu items and settings panels).
By looking at the ScintillaTest XCode project I discovered how it works: you have to import the XCode project called ScintillaFramework, which is the file named ScintillaFramework.xcodeproj (obviously). But that isn't enough, after that XCode still can't find the header files in the framework. I looked at the build settings in the ScintillaTest project and found 'Header Search Paths' set to ../../. Setting this failed in my project, it had to be one directory less back: ../. No I just need to get the compiler to accept the C++ constructs in the Scintilla framework.
Update:
Strangely, this stopped working. I do not understand it either. So I just right-clicked my target, from there: add existing framework...->add other...->[browse to ScintillaFramework/build/Release/Scintilla.framework]. This works partially, see my newest question.