First I apologize if this is a fairly simple question, but I am a newbie to programming. Basically what I want to do is have two UITextField’s where you enter a number into each, then press a button and in a third UITextField the sum of the first two UITextFields is displayed. Is this possible? Basically all I would need to know is how to define the IBAction method of the addition button. Here’s what “I’m thinking” but it doesn’t work because you can’t do math with string values.
-(IBAction)addthefields {
textfield3.text = textfield1.text + textfield2.text;
}
Again sorry if its a simple question but any help is much appreciated
This will probably work. It will add the values u’ve entered to the two textfields to your third textfield.
One thing that u’ll have to keep in mind is that you cant calculate with string values, you’ll need integers, doubles and so on.