Last active
December 15, 2015 19:49
-
-
Save bjhomer/5314527 to your computer and use it in GitHub Desktop.
-Wformat-nonliteral is picky
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *template = NSLocalizedString(@"My name is %@", @"A label for displaying the user's name"); | |
NSString *str = [NSString stringWithFormat:template, @"John"]; | |
// warning: format string is not a string literal [-Wformat-nonliteral] | |
label.text = str; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *str = [NSString stringWithFormat:NSLocalizedString(@"My name is %@", @"A label for displaying the user's name"), @"John"]; | |
// No warning. | |
label.text = str; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment