3

I'm working on an API library and I'd like to add a few warnings that would appear when another developers builds the app if an optional apikey is not included. It should be buildable w/o the key (since it's optional) so I can't just add a syntax error to force a build error.

I know Xcode supports TODO and FIXME but those aren't really highlighted anywhere major.

Any other thoughts on how to approach this?

1 Answers1

24

You can use the #warning preprocessor directive:

#warning This will appear in the compiler warnings output

The text following #warning will appear as a warning during compilation, but it won't prevent the project from being built (unless warnings are treated as errors).

mipadi
  • 398,885
  • 90
  • 523
  • 479