I know there are a bunch of questions and answers about this, but I think my situation is different because it deals with localization. Which is probably why I'm pulling my hair out in understanding why I can't get this warning resolved.
I get the "Format is not a string literal" warning on the following code:
[NSString stringWithFormat:[[NSBundle mainBundle] localizedStringForKey:@"TestCompleted2"
value: @"The test on %@ has completed." table: @"Main"], itemName]
Main.strings:
"TestCompleted2" = "The test on %@ has completed.";
I don't understand A) why its throwing this error and B) how I can fix it.
It clearly has the fill data, so that shouldn't be it. I'm assuming its because localizedStringForKey
could return a different string with different formatting placeholders, which is why it is throwing the error. Is that correct? And if so, how do I fix it?