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!?
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…