iOS include header files via xcode


I developing an iOS application , where i need to include header files and use in my code as
 #include

It is easy enough if you just want to include all *.h files from a third party library . All you need to do is 
1) create new group in you project - by right clicking any where in you xcode project folder structure.
2) Now select the new group and on the right hand side of the xcode you can see the path and select relative to group. 
3) Now set the location to where the header files are copied in your Mac.
4) Drag and drop all the header files to the new created group in xcode. 

It is some more work if you need to include header files with folder name in it. eg:- /file name

Select project target > Build settings > Header search paths. 
set $(SRCROOT)/Headers/ "/file name " - part in quotes is what we include in our .h files. 

NOTE:- Make sure your project folder name is not having any spaces in it. 



No comments: