What is the best way to define a globally accessible string?
I see that for integer it's usually like this #define easy 0
However, how can I emulate that for NSString?
I tried static NSString *BACKGROUND = @"bg.png";
While that work, it does give a warning saying the variable is never used. (I have all these in a .h file)
Doing NSString *const BACKGROUND = @"bg.png";
is even worse since it says duplicate variable when I import the file.
I see that #define BACKGROUND @"bg.png"
seems to work too.
So I guess what is the difference between when to use #define
, const
& static
Thanks,
Tee