Troubles with popUpCell and tableview
Troubles with popUpCell and tableview
- Subject: Troubles with popUpCell and tableview
- From: kubernan <email@hidden>
- Date: Tue, 10 Sep 2002 12:00:28 +0200
Hello,
I have a big trouble when i tried to read the selected item of
a NSPopUpButtonCell which is in a tableView.
First, i have a 2 columns table view built with IB. The third
column is created in my program in awakeFromNib, the third
column contains NSPopUpButtonCell :
NSPopUpButtonCell *aPopUpCell = [[NSPopUpButtonCell alloc]
initTextCell:@"" pullsDown:FALSE];
NSTableColumn *aColumn = [[NSTableColumn alloc] init];
[aColumn setIdentifier:@"function"];
[aPopUpCell setFont:[NSFont fontWithName:@"Andale Mono" size:9.0]];
[aPopUpCell setAlignment:NSCenterTextAlignment];
[aPopUpCell addItemsWithTitles:[NSMutableArray
arrayWithContentsOfFile:[[NSBundle mainBundle]
pathForResource:@"functions.plist" ofType:nil]]];
[aColumn setDataCell:[aPopUpCell autorelease]];
[[aColumn headerCell] setStringValue:@"functions"];
[tab addTableColumn:aColumn];
[aColumn release];
Then, when i need to read the content of the selected item for each row
of this column i do that :
NSTableColumn *tabColumn = [NSTableColumn alloc];
tabColumn = [tab tableColumnWithIdentifier:@"function"];
arrayOfIndex = [[NSMutableArray alloc] init];
int i;
for (i = 0; i < [recordsOfTable count]; i++) // for each row
[arrayOfIndex addObject:[NSNumber numberWithInt:[[tabColumn
dataCellForRow:i] indexOfSelectedItem]]];
[tabColumn release];
This works perfectly under the debugger. But a problem appears AFTER
this code (but i'm not able
to locate where exactly) ; i have a strange message :
2002-09-10 11:41:27.569 NNK S.E 4[928] *** -[NSCFSet width]: selector
not recognized
2002-09-10 11:41:27.584 NNK S.E 4[928] *** -[NSCFSet width]: selector
not recognized
The message comes several times (i can have a lot).
The GUI is completely frozen. If i delete the for... loop, all works
well. I think this is because of this code :
[arrayOfIndex addObject:[NSNumber numberWithInt:[[tabColumn
dataCellForRow:i] indexOfSelectedItem]]]
Why it generates a problem ? Is there another way to read the selected
item of each popupcell ?
Any idea ?
Thx.
K.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.