I need to multiply the value of an nsnumber by a float but they are of course incompatible types. How can I cast the nsnumber to a float?
float result = [myNSNumber floatValue] * myFloat;
Please check the "Accessing Numeric Values" section from NSNumber class reference for converting to other types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With