2

I am developing a static iOS library (that is compiled into a .a file). In the librarys code, I sometimes check if the framework is running in debug mode, as so:

#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 (and is therefore static). 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?

BlackWolf
  • 5,239
  • 5
  • 33
  • 60

0 Answers0