This can happen if you subclass "NSTableRowView" and use that to hi-light the "selected row".
This usually happens when there's a border to the left or to the right.
As per apples example called "TableViewPlaygound" (which can be found here: https://developer.apple.com/library/mac/samplecode/TableViewPlayground/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010727), this is what they use and I use it often for quick and dirty copy and paste hi-lighting:
- (void)drawSelectionInRect:(NSRect)dirtyRect {
NSColor *primaryColor = [[NSColor alternateSelectedControlColor] colorWithAlphaComponent:0.4];
NSColor *secondarySelectedControlColor = [[NSColor secondarySelectedControlColor] colorWithAlphaComponent:0.4];
// Implement our own custom alpha drawing
switch (self.selectionHighlightStyle) {
case NSTableViewSelectionHighlightStyleRegular: {
if (self.selected) {
if (self.emphasized) {
[primaryColor set];
} else {
[secondarySelectedControlColor set];
}
NSRect bounds = self.bounds;
const NSRect *rects = NULL;
NSInteger count = 0;
[self getRectsBeingDrawn:&rects count:&count];
for (NSInteger i = 0; i < count; i++) {
NSRect rect = NSIntersectionRect(bounds, rects[i]);
NSRectFillUsingOperation(rect, NSCompositeSourceOver);
}
}
break;
}
default: {
// Do super's drawing
[super drawSelectionInRect:dirtyRect];
break;
}
}
}
-(void)drawSeparatorInRect:(NSRect)dirtyRect
{
NSRect sepRect = self.bounds;
sepRect.origin.y = NSMaxY(sepRect) - 1;
sepRect.size.height = 1;
sepRect = NSIntersectionRect(sepRect, dirtyRect);
if (!NSIsEmptyRect(sepRect)) {
[[NSColor gridColor] set];
NSRectFill(sepRect);
}
}