Questions tagged [nstableview]

An Apple object that displays data for a set of related records, with rows representing individual records and columns representing the attributes of those records.

NSTableView is OSx component and not be confused with UITableView(an iOS component).

2170 questions
19
votes
1 answer

What makes the difference of cell-based NSTableView and view-based NSTableView?

If my understanding is not wrong, cell-based NSTableView and view-based NSTableView is same type of instance. Then, how cpu distinguish cell-based and view-based? As far as I know, delegate method is different between cell-based and…
user2100702
  • 257
  • 2
  • 8
18
votes
5 answers

reloadData in NSTableView but keep current selection

I have anNSTableView showing the contents of a directory. I watch for FSEvents, and each time I get an event I reload my table view. Unfortunately, the current selection then disappears. Is there a way to avoid that?
AP.
  • 4,945
  • 7
  • 43
  • 94
18
votes
2 answers

Cocoa: How to have a context menu when you right-click on a cell of NSTableView

I have a TableView with custom cells. I want a contextual menu to appear when the user right clicks (or any other Apple variants of right-click) on one of the cells (and know which cell they clicked on). I tried to subclass NSTableView and overwrite…
Nathan H
  • 44,105
  • 54
  • 154
  • 235
18
votes
9 answers

Change NSTableView alternate row colors

I'm using the "Alternating Rows" option in Interface Builder to get alternating row colors on an NSTableView. Is there any way to change the colors of the alternating rows?
indragie
  • 17,634
  • 15
  • 89
  • 161
18
votes
5 answers

Automatically adjust height of a NSTableView

I have asked this question once before, but I'm just not very satisfied with the solution. Automatically adjust size of NSTableView I want to display a NSTableView in a NSPopover, or in a NSWindow. Now, the window's size should adjust with the table…
IluTov
  • 6,509
  • 5
  • 36
  • 94
18
votes
4 answers

Coloring rows in View based NSTableview

I have a view based nstableview. I want to color entire row based on some condtion for which I have used code below - (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row { NSTableRowView *view = [[NSTableRowView…
sach
  • 1,049
  • 3
  • 14
  • 29
17
votes
5 answers

How to create an action from selecting a row from an NSTableView

When I select a row from NSTableView, it is not running the code from tableViewSelectionDidChange method. I had put break points in this method and it is not even going into the method. Any ideas? Am I missing something in my…
Coderama
  • 9,906
  • 12
  • 39
  • 55
17
votes
4 answers

Custom NSTableCellView labels not changing text color when selected

I have a custom NSTableCellView with 3 textfields, 1 that came along and 2 others that i created myself. Here's the problem: The textfields' text color stays the same even when i click on the row. I've tried to implement a code i found out by…
Pedro Vieira
  • 3,222
  • 3
  • 34
  • 71
16
votes
4 answers

Binding view-based NSOutlineView to Core Data

I'm trying to implement the new view-based OutlineView as a source list in my Mac app. I can't get values to display, though, so I made a small test app from the Core Data app template, and can't get it working right in there, either. I defined two…
Dov
  • 14,039
  • 12
  • 71
  • 151
16
votes
5 answers

How to update NSTableView without using -reloadData?

I am new to the Mac. I am trying to update a particular cell in NSTableView without using -reloadData, as -reloadData updates the whole table. I have tried everything but all was in vain. I am trying to do something similar to what we used to do in…
Omayr
  • 1,699
  • 2
  • 21
  • 34
16
votes
4 answers

Show contextual menu on ctrl-click/right-click on header of NSTableView

I'm searching for an elegant way to detect a right-click/ctrl-click on the header of an NSTableView. When the right click occurs, I want to display an contextual menu. - (NSMenu *)menuForEvent:(NSEvent *) detects only right clicks in the table -…
tubtub
  • 163
  • 1
  • 4
16
votes
5 answers

NSTableview View Based Scrolling Performance

I am fairly new to OS X Cocoa programming but have decided to give it a go with the new Swift language. I have an NSTableView with 1500 rows (will be more) and 7 columns. There is one checkbox column and the rest are text fields, one with a date…
Gavin
  • 203
  • 2
  • 11
16
votes
4 answers

NSOutlineView reloadItem: has no effect

I'm trying to release some strain on a view-based NSOutlineView for which I changed a single item property and which I initially reloaded just fine using [myOutlineView reloadData]. I tried [myOutlineView reloadItem: myOutlineViewItem] but it never…
Bertrand Caron
  • 2,019
  • 1
  • 19
  • 42
16
votes
5 answers

NSTableView Right Clicked Row Index

I'm looking for a way to get right-clicked row index from NSTableView but I can't find any delegate methods or class attributes for it. Any suggestion is appreciated.
Abcd Efg
  • 2,058
  • 22
  • 40
15
votes
3 answers

Change highlighting color in NSTableView in Cocoa?

I am developing a Cocoa application and encountered a problem with highlighting. Standard highlighting color in MAC OS X applications is blue, but it doesn't suit my app, since because of design concepts, I need a green color for highlighting. I…
Artem
  • 942
  • 1
  • 7
  • 24