XCode: Use hosting projects preprocessor macros in framework

Hello,


I am developing a static iOS library/framework. (that is compiled into a

.framework
file).

In the library code, I use preprocessor macro value DEBUG if the framework is running in debug mode like,


#ifdef DEBUG

return YES;

#else

return NO;

#endif


The issue is, that when the framework is used in a "host" project, the outcome of the above code will depend on whether the framework was compiled in debug or release mode.

What I want to do is make that outcome depend on whether the hosting project is currently running in debug or release configuration, so that developers using my library can enable/disable debug features on the fly.


I suppose this cannot be achieved using preprocessor macros, as they are... well... preprocessed. But is there any other high-level solution to detect the current run configuration?

XCode: Use hosting projects preprocessor macros in framework
 
 
Q