NSTableView에서 선택한 행의 텍스트가 흑자로 되어 버리는 경우의 대처법
                                            
                                                
                                                
                                                
                                                
                                                
                                                 12600 단어  MacOSXNSColorObjective-CNSTableView
                    
개요
비선택 시

선택 시(macOS 10.14)

선택 시(macOS10.13.6)

해결책
blackColor 로 지정했기 때문에. NSColor.controlTextColor 를 지정하는 것이 좋다. 
참고
UI Element Colors
AppKit Release Notes for macOS 10.14
NSColor to use for selected table view text
alternateSelectedControlTextColor 라고 있는데 이 근처가 관련되어 있는 것일까. 이번에 사용한 코드
- (void)tableView:(NSTableView *)tableView
  willDisplayCell:(id)cell
   forTableColumn:(NSTableColumn *)tableColumn
              row:(NSInteger)row {
AppDelegate.m
#import "AppDelegate.h"
#import "TableViewController.h"
@interface AppDelegate ()
@property (weak) IBOutlet NSWindow *window;
@property TableViewController *tableViewController;
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // Insert code here to initialize your application
    TableViewController *tableViewController = [[TableViewController alloc] init];
    [tableViewController showWindow:self];
    _tableViewController = tableViewController;
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {
    // Insert code here to tear down your application
}
@end
TableViewController.m
//
//  TableViewController.m
//  NSTableView_SelectedRowTextColor
#import "TableViewController.h"
@interface TableViewController ()<NSTableViewDelegate, NSTableViewDataSource>
@property (weak) IBOutlet NSTableView *tableView;
@property NSArray<NSString *> *tableViewData;
@end
@implementation TableViewController
- (id)init {
    if (self = [super initWithWindowNibName:[self className] owner:self]) {
        _tableViewData = @[@"NSColor.blackColor",
                           @"NSColor.controlTextColor",
                           @"NSColor.textColor",
                           @"NSColor.labelColor"];
    }
    return self;
}
- (void)windowDidLoad {
    [super windowDidLoad];
    // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
}
// MARK:- NSTableView Delegate
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
    return _tableViewData.count;
}
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
    return _tableViewData[row];
}
// テーブルビューの内容表示前に呼ばれる
- (void)tableView:(NSTableView *)tableView
  willDisplayCell:(id)cell
   forTableColumn:(NSTableColumn *)tableColumn
              row:(NSInteger)row {
    [cell setTextColor:NSColor.blackColor];
    switch (row) {
        case 0:
            [cell setTextColor:NSColor.blackColor];
            break;
        case 1:
            [cell setTextColor:NSColor.controlTextColor];
            break;
        case 2:
            [cell setTextColor:NSColor.textColor];
            break;
        case 3:
            [cell setTextColor:NSColor.labelColor];
            break;
        default:
            break;
    }
}
@end
Reference
이 문제에 관하여(NSTableView에서 선택한 행의 텍스트가 흑자로 되어 버리는 경우의 대처법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/IKEH/items/d985fdd4126f098e537b텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)