I have a problem : How can i do If i want get value of NSTextField by tag number?
I create NSTextField dynamically and set tag for it by this code :
for(int i=0; i<number;i++)
{
NSTextField *ssid = [[NSTextField alloc] initWithFrame:NSMakeRect (10,label_Y,150,25)];
[ssid setStringValue:[NSString stringWithFormat:@"SSID %d :",i +1]];
[ssid setSelectable:NO];
ssid.tag = i;
[ssid setEditable:NO];
[ssid setBordered:NO];
[ssid setDrawsBackground:NO];
[ssid setAutoresizingMask:NSViewWidthSizable];
[contentView addSubview:ssid];
label_Y -=30;
[ssid release];
NSTextField *ssid2 = [[NSTextField alloc] initWithFrame:NSMakeRect (10,label_Y,150,25)];
[ssid2 setStringValue:[NSString stringWithFormat:@"SSID %d :",i +1]];
[ssid2 setSelectable:NO];
ssid2.tag = i;
[ssid2 setEditable:NO];
[ssid2 setBordered:NO];
[ssid2 setDrawsBackground:NO];
[ssid2 setAutoresizingMask:NSViewWidthSizable];
[contentView addSubview:ssid2];
label_Y -=30;
[ssid2 release];
}
And then i want get value of each NSTextField But i don't know how to get value of NStextfield by tag number? Thanks