Bridging header not found when creating app extension - swift2

Trying to create a document provider app extension for my app, returns me this error when I try to run the project after creating the app extension (just creating it not adding anything else) :
error: bridging header '/myPath/test-Bridging-Header.h' does not exist
Apparently the app extension is not searching at the right path, the bridging header is in the folder with all the classes and the app extension is looking for it at the root of the project.
Any fix?

Probably a problem with the file path you've provided.
By default Xcode will look for your bridging header file from the directory where you can find your xcodeProj file.
In XCode, go to your Project's Building Settings and search for Code Generation. Under Swift Compiler - Code Generation, verify the path you've supplied for your bridging header file.

Related

Duplicating Xcode project - Renaming bridging header

I followed the advice found in Duplicate and rename Xcode project & associated folders
and it worked, except for the bridging header which still needs the old project name as the prefix. How can I change the bridging header name to correspond to the current project name?
I'm not sure I understand your question correctly but if you would like to just rename the Bridging Header file itself you can do that by finding it in the Project navigator, click enter on it and then type the new name.
If however you would like to change the reference when building to point at your new Bridging Header, then you can change that by going to Build Settings for your project, select the proper target and then the easiest is to do a search for Bridging Header. You should now be able to alter the path and name of where your Bridging Header is located.
Hope that answers your question

I can't figure out how to change my header file to "public"

I downloaded the Parse SDK and added all of the dependencies as well as the Parse.framework and Bolts.framework. Then I went to my app delegate and
started to import Parse and Bolts. Then I got an error saying "Could not build Objective-C module 'Bolts'". This was because of many errors in the Bolts.h file which all said "Include of non-modular header inside framework module 'Bolts'". So after some research I found that people have fixed this error by changing their header file to "public". But when I tried to do this the only options I get in the "target membership" column, after selecting the Bolts.Framework, is to make it required or optional. Why am I not getting the public, private, and project options? What other way can I find those options?
Select the header file in the Project Navigator (right pane of XCode). In the Utilities pane (far right) select the File Inspector tab. Under Target Management you should be able to select the target and change that property.
Incidentally, I had the same issue (both FacebookSDK and Bolts installed). By removing Facebook from Library Search Paths (under Build Settings) I was able to get it working.

Xcode auto include header for sibiling project

i have a workspace in xcode with two project (sibiling, not parent->child) a project is a static library, and other project is a standard app.
Now i need to drag headers file from library project to app project but this a bit annoying, how i need to configure 'header search path' parameter?
thanks
I add other details: now the path is:
$(SRCROOT)/../Build/Products/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/include/UtilityLibrary
i create a Build folder and from xcode preferences i configured this folder to receive all builed prioject.

Copy .dylib library from one xcode project to another

So I have one Xcode project that I downloaded that comes with a ~.dylib file and a folder titled 'include' that comes with all the files for that library.
What I want to do is copy these files into another XCode project.
However I don't know how to get XCode to recognize the ~.dylib file. Right now XCode allows me to create instances of classes defined in this library but whenever I try to call any associated methods it says it can't find those methods and gives an error (presumably because the ~.dylib file is not linked properly.
Try this: Select your project file, choose your target, Build Settings, and search for "Library Search Paths", and add the path to your dylib file to it.

Adding a static library to an XCode console application

I'm having trouble adding a static library from another Xcode project (CloudApp API) to my Xcode project. My project has two targets -- a prefpane bundle, and a console application. I want to add the static library to the console application. Here's what I've done so far:
Created a new workspace
Added the CloudApp project to my workspace
Added the libcloud.a file to my "Link Project Binaries" list for the target binary
Added -ObjC to the "Other Linker Flags" setting for the target binary
Added $(BUILD_PRODUCTS_DIR) to the "User Header Search Paths" setting for the target binary
Copied all the relevant headers from the CloudApp project into my project (without adding them to the target) so that I don't get errors from any #import statements
Edited the scheme for the target binary to require compiling CloudApp first
Added relevant frameworks to the target (Cocoa, Foundation, CoreFoundation)
Doing all this worked fine when I just had a single Cocoa target (not a console application). But now I'm getting errors in the CloudApp header files I included. Basically things like this:
In CLWebItem.h:
Unknown type name 'NSImage'
Any ideas?
Create a prefix-header.pch and #import <Cocoa/Cocoa.h> inside. Make sure to compile the prefix header in your settings.

Resources