I'm writing an app for the iOS in XCode 4 and stumbled upon an issue with #import statement.
All my source files are organized in folders, every folder is mapped to the group or subgroup in XCode. Consider the following:
ProjectFolder
-SubFolderA
--FileA.h
-SubFolderB
--FileB.m
Usually, if I want to import FileA into FileB, I write #import "FileA.h"
, and it works perfectly. But sometimes I have to write relative path, like #import "../SubFolderA/FileA.h"
. What should I do to be always able to write only name of the file?
This behavior seems undetermined to me.
PS: I don't want to keep all this mess in one root folder.
PS#2: Yes, I know how the 'folder' differs from 'group'. I've created folders on the early stage of the project, dragged them from Finder to XCode and mapped them to groups. And everything worked just fine - I was able to import headers using only filenames.