I am using Xcode 4.6 and I have a header file that contains some constants that I use in all my code. I do not want to use preprocessor directives because I want them to be printed correctly and such.
For example, I have this code in one of my .h files:
static NSString *kErrorCannotDivideByZero = @"Error: Cannot divide by zero";
and I use it in the corresponding .m file:
[self showToast:kErrorCannotDivideByZero]
I get a warning:
/path/to/my/headerFile.h:32:18: Unused variable 'kErrorCannotDivideByZero'
I only know this warning, but I have about 50 of these warnings cluttering my compiler output.
Why am I getting this warning and how can I solve it?
I donβt just need to suppress all unused variable warnings because I want to get legitimate ones.
c objective-c xcode
Kenny wyland
source share