1

I'am a newcomer to cocoa developement and i have not yet got used to.

When use eclipse for java development, we can see all the added jars source file if we attached the source files.

But in xcode, we add a framework such as "Cocoa.framework",there is only one Cocoa.h file we can see. eg: I clone the 'Sonora' source code from github for study. there is one line

#import "SNRFileCopyManager.h"

exist in SNRFileImportOperation.h file

Both the SNRFileImportOperation.h and SNRFileCopyManager.h can be found in Sonora/Classes directory. But, i can see the SNRFileImportOperation.h file in xcode project only and they get work fine together, Why this non third party header file not display in it's own project?

I know something about the dependency setting adn header search paths. Any one give me a guidance or some references of the code management|organization? Thanks a lot.

1 Answer 1

1

The file SNRFileCopyManager.h is found because it is in one of the include search paths. If you select a header file in Xcode and look at the info panel on the right side you can see that it doesn't actually belong to any target, they are shown more or less regardless. Though, building a framework you can select header files to be included into the framework when building. So, you can just pull in your header files into Xcode.

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

I have pinpointed the problem. I simulate it by the follows: I create a new file and delete with reference, then i can still import it in another file. this confuses me, What is the meaning of this? Why the author delete the reference? What is the use of reference?
Xcode isn't actually what is reading the files during "compilation" (building the app), it is the compiler. The compiler read the Objectice-C .m files and is feed a number of file system paths that is used to search for files that is imported, so any "#import" files will be searched for in these locations regardless if the file is in the Xcode project list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.