Reputation: 1
I'm trying to make a unit converter as my first app. I've been having trouble getting the numeric value from the textfield, so I can multiply it by whatever constant to convert the units. Also, how can I add a decimal place to a numeric key pad?
Upvotes: 0
Views: 1292
Reputation: 13686
Use the NSString doubleValue property to convert the string value from the UITextBox into a double.
double d = [str doubleValue];
Upvotes: 4