Reputation: 31
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?
Upvotes: 3
Views: 2797
Reputation: 410542
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).
Upvotes: 24