Cue
Cue

Reputation: 3092

How to avoid in a Mac app that an item of a NStableView is highlighted when empty?

I have a app for macOS where I use a view based NSTableView as a list of clickable items that start an action. Because in Cocoa there are not groups in tableView I separated all the items of a certain type with a blank item (which has three spaces as text).

How can get to not highlight the item with three space as text?

Upvotes: 0

Views: 30

Answers (1)

Willeke
Willeke

Reputation: 15589

Implement delegate method

- (NSIndexSet *)tableView:(NSTableView *)tableView selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes;

or

- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row;

Upvotes: 1

Related Questions