开发者

How to set a CGFloat to a UILabel's text property

I have a UILabel calle开发者_开发问答d optionsDisplayerBrushSizeLabel who's text property I want to set to a CGFloat: brushSizeVal. I understand that the text property needs to be a string but I don't know how to convert a CGFloat to an NSString.


You can try:

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


Tray this in swift

var a = String (stringInterpolationSegment:myFloat)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜