4
식별자로 빈 문자열로 열을 만들려고하지만 열을 만들려고 할 때마다 Cocoa가 빈 문자열을 "필드"단어로 바꾸는 것으로 보입니다. 이걸 어떻게 둘러 보니?문제 이름 NSTableColumn
- (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];
}
많은 감사합니다. 잊어 버렸습니다. – ruipacheco
코드에서 다소 직관적이라고 생각합니다. NSControl 및 하위 클래스는 메시지를 셀에 전달합니다. NSTableColumn에는 헤더 셀의 문자열 값에 문자열을 전달하는 -title/-setTitle : 메서드가 있어야한다고 생각합니다. 누군가가 개선 요청을 제기해야하지만 ... 너무 게으르다. :-) –
@Joshua Nozzi 참으로 – valexa