Is there a precompiler directive that checks if a framework is linked in an Obj-C/Cocoa project?
For example, I have a class of useful categories with some MapKit categories. However, if MapKit is not linked to the framework, then those categories will not compile.
Is there anything like:
#ifdef MAPKIT
....
// Only compiles if MapKit framework is linked to the current project
....
#endif
No. Preprocessing and compilation happens at one build phase — Linking is a separate phase.
Xcode does not provide an easy way for you to access/enumerate the build settings related to linking in a source file.