Alright, I'm new to programming with XCode. I figured I would try something simple as my first program. I searched online for about a week for just what is wrong and I have no idea. I hope that someone can help me here. All I am trying to do is to take one number, multiply by a second number, and then post the product. All data is in/out puted into NSTextFields with an NSButton calling the multiply action. It compiles fine with no errors but when it runs, no product value appears in the third textfield after the button has been pressed.
Code:
MultiplyController.h
#import <Cocoa/Cocoa.h>
@interface MultiplyController : NSObject {
IBOutlet id firstNumber;
IBOutlet id product;
IBOutlet id secondNumber;
}
- (IBAction)multiply:(id)sender;
@end
Code:
MultiplyController.m
#import "MultiplyController.h"
@implementation MultiplyController
- (IBAction)multiply:(id)sender
{
[product setIntValue: [firstNumber intValue] * [secondNumber intValue]];
}
@end