Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

medasmx

macrumors member
Original poster
Nov 9, 2008
89
0
This is a rewrite from my previous nsmatrix post. I included all the code. There are two matrices (embedded in customviews). One is 1x3. In the first textfield (of the first matrix) you input a string. In the next two textfields, you state where in the second textfield matrix you want to put the string (this is a 2x2 matrix of textfields). To make the matrices I embedded textfields in custom view windows. There is one button that inputs from the first matrix. It compiles without errors, but then I get the message -- "asmcustomview[15725:10b] Unknown class NSmatrix in Interface Builder file." That happens when it loads before anything is inputted. When the button is pushed, I get the message -- "asmcustomview[15725:10b] *** -[NSTextField copyWithZone:]: unrecognized selector sent to instance 0x133ed0." Below is the code. Thank you in advance for any help. Adam

Code:
#import <Cocoa/Cocoa.h>


@interface asmcv : NSObject {
IBOutlet NSMatrix*myMatrix1;
IBOutlet NSMatrix*myMatrix2;
IBOutlet NSTextField*prototypeTextField;
int i,j;
NSString*myString;
}
-(IBAction)myButton1:(NSButton*)sender;

@end

#import "asmcv.h"
@implementation asmcv

-(id)init
{
[super init];
prototypeTextField=[[NSTextField alloc]init];
return self;
}

-(IBAction)myButton1:(NSButton*)sender;
{
NSMatrix*myMatrix1 = [[NSMatrix alloc] 
    initWithFrame:NSMakeRect(138.0f, 85.0f, 0.0f, 0.0f)
    mode:NSRadioModeMatrix
    prototype:prototypeTextField 
    numberOfRows:1 
    numberOfColumns:3];
NSString*myString=[[NSString alloc]init];
int i,j;
i=[myMatrix1 selectCellAtRow:1 Column:2];
j=[myMatrix1 selectCellAtRow:1 Column:3];
myString=[myMatrix1 selectCellAtRow:1 Column:1];
NSMatrix*myMatrix2 = [[NSMatrix alloc] 
    initWithFrame:NSMakeRect(138.0f, 85.0f, 0.0f, 0.0f)
    mode:NSRadioModeMatrix
    prototype:prototypeTextField 
    numberOfRows:2 
    numberOfColumns:2];
NSString*myCell=[[NSString alloc]init];
myCell=[myMatrix2 makeCellAtRow:i column:j];
}

@end
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.