indexOfItemWithStringValue gets a nil string?
indexOfItemWithStringValue gets a nil string?
- Subject: indexOfItemWithStringValue gets a nil string?
- From: "Theodore H. Smith" <email@hidden>
- Date: Tue, 28 Jun 2005 20:02:37 +0100
I'm trying to implement some NSComboBoxCells in an NSTableView.
Strangely, though, I'm getting a nil string to
comboBoxCell:indexOfItemWithStringValue:
I must be doing something wrong. But I cannot figure out what. I'm
setting the [cell stringValue] to a positive length'd string. My UI
does display a proper value into the NSTableView's cell, more
importantly.
It's not documented anywhere why
comboBoxCell:indexOfItemWithStringValue: would get a nil string.
Here's my code that is called from within willdisplaycell
void FillMetaCell( MyController* self, NSComboBoxCell* cell, int row ) {
NSArray* a = FrontCB()->MacMetaArray(row);
[cell setRepresentedObject:a];
[cell reloadData];
NSString* CurrString = [self MetaDataForRow:row];
assert( [CurrString length] );
int cellRow = [a indexOfObject:CurrString];
[cell setStringValue:CurrString];
[cell selectItemAtIndex:cellRow];
}
Any clues anyone?
I'm thinking of just ignoring the param passed to
comboBoxCell:indexOfItemWithStringValue: and just calculating it
another way, however that would be accepting defeat and leading to
slightly worse code.
--
http://elfdata.com/plugin/ Industrial strength string processing,
made easy.
"All things are logical. Putting free-will in the slot for premises in
a logical system, makes all of life both understandable, and free."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden