When compiling this:
char *str = [[NSString stringWithFormat:@"%i days and %i hours", days, hours] UTF8String];
I get this warning:
initialization discards qualifiers from pointer target type
How do I get rid of it?
The qualifier you’re missing is const. -UTF8String returns a const char *, so str should also be declared const char *.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With