Hey Guys ,
I have two text fields in which numbers are inputed as strings. I need to convert the strings to numbers, add them together and then display the result in a 3rd textfield.
I am totally new to iPhone programming .. So please don't be hard on me :P
Ok here is the problem
AdditionViewController.h
#import <UIKit/UIKit.h>
@interface AdditionViewController : UIViewController
{
IBOutlet UITextField *Number1;
IBOutlet UITextField *Number2;
IBOutlet UITextField *SumAnswer;
}
@property (retain, nonatomic) UITextField *Number1;
@property (retain, nonatomic) UITextField *Number2;
@property (retain, nonatomic) UITextField *SumAnswer;
-(IBAction)buttonPressed1:(id)sender;
@end
AdditionViewController.m
#import "AdditionViewController.h"
@implementation AdditionViewController
@synthesize Number1;
@synthesize Number2;
@synthesize SumAnswer;
-(IBAction)buttonPressed1:(id)sender
{
SumAnswer.text = Number1.text + Number2.text;
// I want the above line to be edited so that I can get the addition
of both the numbers in the 3rd Text Field
}
-
-
-
-
-
@end
I am really new to iPhone programming .. I am trying to understand how NSString can be used here .. But I am finding it a bit complicated .
If someone please tell me what the code should be ... It will be a great help . I have to submit a mini project to my school asap .
Thanking You , int3rc3pt0r