#warning directive
The #warning directive is to see the message on the compiler. This is very handy to know that something must be changed before deploying or simply to remember to change a piece of code that can be improved (but you don't have the time to do so now). (go to View -> Navigators -> Show Issue Navigator on your project and you will the see the list of warnings). These messages will not appear on the console.
The Apple System Log facility
What you want is to show a warning to the console while the app is running and here is where The Apple System Log facility comes to the rescue.
You have 8 logging levels:
- 0 Emergency.
- 1 Alert
- 2 Critical
- 3 Error
- 4 Warning
- 5 Notice
- 6 Info
- 7 Debug
Code sample:
#include <asl.h>
...
asl_log(NULL, NULL, ASL_LEVEL_INFO, "Hello World!");
Since I was in the same situation than you once, and to make things simple, I use this wrapper https://github.com/MikeWeller/MWLogging in all my projects so my debug errors won't show when I send my App to the App Store but other critical error will.
Update: Now with Swift I use this debug log framework https://github.com/DaveWoodCom/XCGLogger
#warningin the build console.