Well, I can press a button (called calculate) and add two int numbers if they are constants. But, if I try to get input from textfields and add them, I get zero for the answer.
I tried setting the textfields as outlets - didn't help. Here's the .m code snippet:
int xIn1, xIn2; // declare variables
- (IBAction)calculate:(id)sender {
xIn1 = [TextField1 intValue]; // if = constant, it works
xIn2 = [TextField2 intValue];
[resultY setIntValue: (xIn1 + xIn2)];
}
Any help is appreciated - thanks!
@end
Submitted by Anonymous (not verified) on Tue, 12/01/2009 - 01:04.
Well, I can press a button (called calculate) and add two int numbers if they are constants. But, if I try to get input from textfields and add them, I get zero for the answer.
I tried setting the textfields as outlets - didn't help. Here's the .m code snippet:
int xIn1, xIn2; // declare variables
- (IBAction)calculate:(id)sender {
xIn1 = [TextField1 intValue]; // if = constant, it works
xIn2 = [TextField2 intValue];
[resultY setIntValue: (xIn1 + xIn2)];
}
Any help is appreciated - thanks!
Submitted by Anonymous (not verified) on Tue, 12/01/2009 - 01:04.@end