Home Convert [Float] to variables arguments
Reply: 0

Convert [Float] to variables arguments

user689
1#
user689 Published in April 27, 2018, 6:42 am

I'm trying to use NSString(format: , arg...) to update a UILabel by incrementing one or more values in this label.

To do that, I have a function where I am receiving the args as Float... (which is what I want) and the only solution I found to store them is by using an array [Float] (which is not what I want). Then, I'm modifying each value of my array to display it.

To modify the text of my UILabel, I am using label.text = NSString(format: "%f and %f", myArrayOfFloat) and it does not work. NSString takes the array as a single value, not as an array.

If anyone has a solution, I'm all ears.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308995 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO