Question

J'ai un UILabel appelé optionsDisplayerBrushSizeLabel qui est la propriété de texte que je veux mettre un CGFloat: brushSizeVal. Je comprends que la propriété de texte doit être une chaîne, mais je ne sais pas comment convertir un CGFloat à un NSString.

Était-ce utile?

La solution

Vous pouvez essayer:

[NSString stringWithFormat: @"%.2f", myFloat];

Autres conseils

dans ce bac rapide

var a = String (stringInterpolationSegment:myFloat)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top