开发者

ABPeoplePickerView - How do I get it to scroll to a selected record?

开发者 https://www.devze.com 2022-12-11 14:59 出处:网络
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.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消