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 th开发者_Go百科e 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.
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 ;)
How about the scrollPersonToView method?
精彩评论