I have a NSTableView
with a NSImageCell
in it. I would like to add a tooltip that when I hover the image with the mouse i get a tooltip with the Path of the image. What is the best way to do this?
the problems I have are these:
please keep your answers easy, I am a newbie.
---EDIT---
additional info: myarray.arrangedobjects is what fills the table. it is an array of NSMutableDictionaries. the dictionary has following Keys:
You will need to provide a delegate for the NSTableView
and implement this delegate method:
– tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:
You can find the docs for the NSTableViewDelegate
protocol here. You need to make sure to plug the delegate into the delegate outlet on the NSTableView
using IB. Your method will not be called unless that has been done. Also, it's worth noting that this delegate method is called on demand, not up-front, so it wont get called until you've parked your mouse hovering over a cell. This approach should work for both tables with a data source and tables that use bindings.
I put a trivial example up on GitHub.