Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从另一个类中进行的计算中传递 ProgressView 一个浮点数。我尝试通过将其转换为 NSDecimalNumber 来传递它,但是当它到达目的地时我无法再次将其恢复为浮点数。一定有比这更好的方法。
myUIProgressView.value = someFloat; // where someFloat is just type float between 0.0..1.0
应该管用。如果您使用 anNSNumber来保存值,则可以使用[myNSNumber floatValue];来获取其浮点表示。
NSNumber
[myNSNumber floatValue];