'NSLocalisation of String
the following localisation string is not working. this works fine if i use @%i Sides, as the system seems to ignore the @%i, but if i change to @%li, then the localisation string is not found.
i only make the change to silence a warning in Xcode asking me to use a cast to long.
any ideas anyone
thanks
this works but i get a warning
Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead
numberOfSidesLabel.text = [NSString stringWithFormat:NSLocalizedString(@"%i Sides",%i Sides),polygon.numberOfSides];
this gets rid of the warning but the localisation string fails
numberOfSidesLabel.text = [NSString stringWithFormat:NSLocalizedString(@"%li Sides",%li Sides),(long)polygon.numberOfSides];
this is my localisation string :
/* Class = "IBUILabel"; text = "Sides"; ObjectID = "oYY-ih-zqz"; */
"oYY-ih-zqz.text" = "Sides";
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|