How is the cell value given to an NSPopUpButtonCell
An `NSTableView` has multiples `NSCell`s (indirectly via `NSTableColumn`).  NSCell follows the Flyweight design pattern; they're cookie-cutters.  There's one cell per column and it's asked to draw itself for each row.  _"Here's a value, draw it on the first row;  here's the value for the second row, etc."_  This is in contrast to view-based tableviews which have a view instance per cell.

I've subclassed NSPopUpButtonCell and for each `setXxxValue:` method, I call `NSLog();` and forward the message to the super class.  The only method which gets called (say, when adding new rows, or otherwise refreshing the table) is `setObjectValue:`.  This is expected from the [documentation](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPopUpButtonCell_Class/Reference/Reference.html#//apple_ref/occ/instm/NSPopUpButtonCell/setObjectValue:)... but `null` is the only thing passed to it!!  It should be passed an NSNumber with the selected item index.

_My table draws fine._  I'm just trying to understand this because I want to extend/change the behaviour of the cell (obviously as I would'nt have needed a subclass otherwise).

**Question:** How is this possible?  How is the NSPopUpButtonCell being set to a value in order to draw the right value for each row. Even considering bindings, it's NSTableColumn doing the heavy lifting, no?  What am I missing?

---

The reason behind : The popup menu needs three sections:

 - A middle part which contains preset values (values users are going to choose 80% of the time),  This part works pretty much like a default popup menu.
 - The bottom part contains a single menu item : "Other..." which, upon selection, presents a panel (a PopOver Window as of now) to define a custom value.
 - The top part would only display if the current value is not one of the listed presets, and would display the custom value.

Because every row in a table shares the same popup menu, I'm trying to intercept the signal setting the value of the cell so that I may show/hide/rename the "custom value" menu item for the row at hand.  Right now, any row with a custom value display "Custom Value" (the placeholder I have).  I want to rename that item for each row to reflect the actual value.
How is the cell value given to an NSPopUpButtonCell
===

An `NSTableView` has multiples `NSCell`s (indirectly via `NSTableColumn`).  NSCell follows the Flyweight design pattern; they're cookie-cutters.  There's one cell per column and it's asked to draw itself for each row.  _"Here's a value, draw it on the first row;  here's the value for the second row, etc."_  This is in contrast to view-based tableviews which have a view instance per cell.

I've subclassed NSPopUpButtonCell and for each `setXxxValue:` method, I call `NSLog();` and forward the message to the super class.  The only method which gets called (say, when adding new rows, or otherwise refreshing the table) is `setObjectValue:`.  This is expected from the [documentation](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPopUpButtonCell_Class/Reference/Reference.html#//apple_ref/occ/instm/NSPopUpButtonCell/setObjectValue:)... but `null` is the only thing passed to it!!  It should be passed an NSNumber with the selected item index.

_My table draws fine._  I'm just trying to understand this because I want to extend/change the behaviour of the cell (obviously as I would'nt have needed a subclass otherwise).

**Question:** How is this possible?  How is the NSPopUpButtonCell being set to a value in order to draw the right value for each row. Even considering bindings, it's NSTableColumn doing the heavy lifting, no?  What am I missing?

---

The reason behind : The popup menu needs three sections:

 - A middle part which contains preset values (values users are going to choose 80% of the time),  This part works pretty much like a default popup menu.
 - The bottom part contains a single menu item : "Other..." which, upon selection, presents a panel (a PopOver Window as of now) to define a custom value.
 - The top part would only display if the current value is not one of the listed presets, and would display the custom value.

Because every row in a table shares the same popup menu, I'm trying to intercept the signal setting the value of the cell so that I may show/hide/rename the "custom value" menu item for the row at hand.  Right now, any row with a custom value display "Custom Value" (the placeholder I have).  I want to rename that item for each row to reflect the actual value.