2

I'm using the ABPeoplePicker in a Mac OS X application. I've hooked up a button that changes the selected record to the default 'Me' record.

This works fine, and the record gets selected, but, I need to scroll the table to see the selected record.

NSTableView has the -scrollRowToVisible:(NSInteger)rowIndex method, but I can't find anything similar for the ABPeoplePickerView

There is a notification ABPeoplePickerNameSelectionDidChangeNotification that is posted when the selected record changes, but I can't find a way of plugging in a property of the record into the view so I can make it visible.

Abizern
  • 146,289
  • 39
  • 203
  • 257

2 Answers2

1

It will automatically scroll to your selection when using selectRecord:byExtendingSelection: for example:

[peopePickerView selectRecord:[[ABAddressBook sharedAddressBook] me] byExtendingSelection:NO];

Be sure you're passing NO for the byExtendingSelection argument.

PS: Previous poster is in iPhone land ;)

Ken Aspeslagh
  • 11,484
  • 2
  • 36
  • 42
0

How about the scrollPersonToView method?

geowar
  • 4,397
  • 1
  • 28
  • 24