loadTempValue
is an NSNumber *
and 0.420
is a float
. You're trying to multiply an object by a float which the compiler does not understand.
What you want to do it get the float value from loadTempValue
and then multiply that by 0.420
. You do that this way:
[loadTempValue floatValue] * 0.420;
From there, it seems like you want to put that value back into an NSNumber *
object, you do that like this:
@([loadTempValue floatValue] * 0.420);
The @( ... )
syntax was recently introduced to Objective-C. It's called object literal notation for numbers. It is a shorthand way of writing [NSNumber numberWithFloat: ...]
Finally, you will want to assign the result to a variable called myValue
; you can accomplish that like this:
NSNumber *myValue = @([loadTempValue floatValue] * 0.420);