4

I am trying to add many Objective-C files to my Swift project with folder reference mode that means when I drag and drop my files into project I am selecting "Create Folder Reference".

This is because all of my obj-c files use #include "/folder/folder/folder/" for example. These files are generated with j2objc project.

Now my problem is when I want to #import or #include some .h of these files in myproject-Bridging-Header.h Xcode can't find the header files. I use #import "/folder/folder/folder/" like generated files but no chance.

I add $(PROJECT_DIR)/ in build settings - search header paths but it does need to write path completely like $(PROJECT_DIR)/folder/folder/folder/. Is there any way to set main folder and Xcode find subfolders ? Or do I need to write every path separately ?

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
Sajjad Hajavi
  • 501
  • 7
  • 9

1 Answers1

3

I found the answer after many days by myself!

When I drag and drop my files to my project in Xcode in mode "Create Folder Reference", just a reference to the files is added to Xcode and the files were in their folder where in my Mac.

I resolve this problem by add files to project's folder manually and then drag and drop from that location to Xcode. After that, I could access my file by its address in myproject-Bridging-Header.h like #import "/folder/folder/folder/file.h"

jscs
  • 63,694
  • 13
  • 151
  • 195
Sajjad Hajavi
  • 501
  • 7
  • 9