Below is code for a basic ten button nsmatrix(of numbers), which should output the number to a text-field. The difficulty I am having is setting the ibaction (mytextoutput) to the matrix -- I can't do it in the IB. It only allows myMatrix to be set to the matrix, Do I need to do this programatically. I have tried to read about tags but not getting anywhere. The program runs without errors but when pushing buttons nothing happens. Thanks. Adam.
#import <Cocoa/Cocoa.h>
@interface AppController : NSObject {
IBOutlet NSTextField*myTextField;
IBOutlet NSMatrix*myMatrix;
}
-(IBAction)myTextOutput
id)sender;
@end
#import "AppController.h"
@implementation AppController
-(IBAction)myTextOutput
id)sender
{
[myTextField setStringValue:[[NSMatrix selectedCell]title]];
}
@end
#import <Cocoa/Cocoa.h>
@interface AppController : NSObject {
IBOutlet NSTextField*myTextField;
IBOutlet NSMatrix*myMatrix;
}
-(IBAction)myTextOutput
@end
#import "AppController.h"
@implementation AppController
-(IBAction)myTextOutput
{
[myTextField setStringValue:[[NSMatrix selectedCell]title]];
}
@end