Pergunta

Estou tentando criar uma coluna com uma corda vazia como o identificador, mas o cacau parece substituir a corda vazia pela palavra "campo" toda vez que tento criar a coluna. Como você faz isso?

- (void)addColumnWithCheckboxToTable:(NSTableView *)table
{
    // Add column with checkbox before all other columns
    // This column will have no title and should be as wide as the checkbox
    NSTableColumn *column = [[[NSTableColumn alloc] initWithIdentifier:@" "] autorelease];

    // The checkbox is to be initialised without a title
    NSButtonCell *checkbox = [[[NSButtonCell alloc] initTextCell:@" "] autorelease];
    [checkbox setEditable:YES];
    [checkbox setButtonType:NSSwitchButton];
    [checkbox setImagePosition:NSImageOnly];
    [checkbox setControlSize:NSSmallControlSize];

    // Add column with checkbox to table
    [column setDataCell:checkbox];

    // Add column to table
    [table addTableColumn:column];
}
Foi útil?

Solução

O identificador de uma coluna não é a mesma coisa que seu título. Você deseja definir o valor da string -headercell:

[[columnColumn headerCell] setStringValue:@""];
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top