0

I'm trying to get rid of unneeded headers in my XCode project by taking them out one at a time and seeing if they cause a compiler error.

Sometimes, I can take out a header that declares a class, and Xcode still lets me use it.

For example, I took out #import "Chartboost.h", but there was no error on the line Chartboost *cb = [Chartboost sharedChartboost];

Option-clicking on Chartboost says it is declared in NSObject.h

How can my code still compile when I'm not importing the header file!?

4

2 回答 2

2

You are importing Chartboost.h, but through one of the other imported headers. This way you don't need to clutter up every class header with an endless number of header-files. Too bad XCode isn't better at telling us which headers are already available...

于 2013-01-31T20:58:21.150 回答
1

If you're not importing Chartboost.h then Chartboost *cb = [Chartboost sharedChartboost]; will most definitely give an error.The only possible explanation is that you might be importing some other file which in turn might be importing Chartboost.

于 2013-01-31T20:54:00.277 回答