Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sigjuice

macrumors member
Original poster
Mar 14, 2008
54
7
Hi,

I need an NSTableView to remember its contents and selected row in
User Defaults. I can get this to work using these bindings

mytableview.content <-> myarraycontroller.arrangedObjects <-> Shared
User Defaults Controller.somearray

mytableview.selectionIndexes <-> myarraycontroller.selectionIndexes
<-> Shared User Defaults Controller.someint (via an
integer-to-NSIndexSet value transformer)

When the tableview appears, I'd like the selected row to scroll and
become visible. It appears that
scrollRowToVisible: will do this for me, but I cannot figure out where
to insert the call to this method. None of the NSTableView delegate
methods look suitable. Maybe I need to subclass NSTableView, but
again, I'm not sure what method I need to override.

Thanks in advance for any suggestions!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.