If you are talking about how to get the values ββand convert them to a number format, then something like the following should do the trick ...
// Grab the values from the UITextFields. float pressureValue = [[pressureField text] floatValue]; float temperatureValue = [[temperatureField text] floatValue]; // Multiply them. float h = pressureValue * temperatureValue;
You should simply replace the original string h = 23; to the above. (However, I did not check the above in the compiler, but it is quite simple, so everything should be fine.) :-)
What you are doing here is to get a text value from UITextFields (which you presumably configured as IBOutlets in the interface file) that are delivered as NSString using the UITextField text method. Then we use the NSString floatValue method to get the value in a suitable number format.
By the way, I really recommend reading the Apple class reference documentation well (for example, the UITextField and NSString documents linked above) - this is very good quality, and you will learn a lot from just looking at some of the available methods.
source share