Tutorial :Custom warning in Xcode



Question:

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?


Solution:1

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).


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »