In the beginning of the chapter, you write:
“Note that we don’t import Foundation.h. How then can we use NSMutableArray? In this template, the Foundation Framework header is part of the precompiled header file for this project, so Foundation classes are available to use”.
There is a couple of things I don’t understand about this.
It is correct that Foundation.h is in the precompiled header file, but so is UIKit.h, so why the need for including this in the BNRAppDelegate.h file?
Also, when doing the Foundation Command-Line programs, we still needed to include the Foundation.h file, even though it is also a part of that template’s precompiled header file?
Also, as far as I understand precompiled headers, all they do is they precompile the headers to cut down on compile time, so headers that aren’t changed very often and used all over the place are optimal candidates for inclusion in the precompiled header file - like Foundation.h and UIKit.h. But I have never heard that it means I didn’t need to include these header files.
By including UIKit.h I also indirectly include Foundation.h; e.g. by including UIKit.h I include UIButton.h which include Foundation.h. Isn’t that why I don’t need to include Foundation.h?